Skip to content

Wip/2026 04 14 server fixes#31

Open
msdebize wants to merge 11 commits into
paritytech:masterfrom
pLim-Inc:wip/2026-04-14-server-fixes
Open

Wip/2026 04 14 server fixes#31
msdebize wants to merge 11 commits into
paritytech:masterfrom
pLim-Inc:wip/2026-04-14-server-fixes

Conversation

@msdebize
Copy link
Copy Markdown

No description provided.

msdebize and others added 11 commits March 27, 2026 17:15
Pallets:
- plim-identity (366): DID registry, ZK proof, credentials
- plim-payments (454): intents, execute, escrow, refund
- plim-mandates (310): Peter Todd single-use seals
- plim-channels (371): micropayment channels with dispute
- plim-delegation (334): spending policies, kill switch
- plim-compliance (351): KYC/AML decision engine
- plim-reputation (261): score 0-1000, FIFO history
- plim-timestamps (259): Merkle tree aggregation

All FRAME V2 compliant with BoundedVec, MaxEncodedLen.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- chain_spec.rs: Plim Chain Testnet, PLIM token, 12 decimals
- runtime: all 8 pallets at indices 10-17
- Dockerfile: multi-stage Rust build
- plim-node.service: systemd for bare-metal
- genesis: 1M PLIM per test account

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fixed sc_chain_spec → serde_json::Map
- Fixed turbofish syntax
- Added serde_json to node deps
- Binary: 73MB release build
- Dev node producing blocks on port 9944

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Generated chain specs: dev, testnet (plim_testnet), mainnet (plim_mainnet)
- Raw specs for validator deployment
- Systemd service templates for testnet and mainnet
- chain-manager.sh for network switching

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Bootstrap-ready runtime upgrade for the next Plim Chain mainnet (v2),
with no Alice sudo and a proper multi-token catalog.

Runtime:
- Add pallet-assets 42.0.0 (matching frame-system 40.1.0) at index 8.
- Remove pallet-template stub (was at index 7).
- Bump spec_version 100 -> 101.
- pallet-assets Config uses EnsureRoot force + EnsureSigned create,
  AssetDeposit=100 UNIT, stablecoin-friendly metadata deposits.
- PlimPayments Config gains Currency + MaxMandatesPerAccount=64.

PlimPayments pallet (was a 33-line stub):
- Real mandate-gated payments: create_mandate / revoke_mandate / pay.
- MandateInfo storage keyed by [u8;32] mandate_ref, enforcing
  expiry + remaining allowance + max-per-payer.
- pay() delegates to fungibles::Mutate::transfer over pallet-assets,
  emitting PaymentExecuted { from, to, asset_id, amount, mandate_ref }.
- Mock runtime + 3 unit tests (create/duplicate/revoke).

Mainnet v2 genesis preset (runtime/src/genesis_config_presets.rs):
- mainnet_genesis(): fresh sudo/treasury/team/aura/grandpa public keys
  hardcoded via hex-literal (mnemonics live only in
  /root/SECURE/mainnet_v2_keys_2026-04-14.txt chmod 600 root-only).
- Treasury 100M PLIM, team vesting 50M PLIM, sudo 1k PLIM gas-only.
- Assets: ePL(1), gPLIM(2) at 12 dec; pEUR(3), pUSD(4) at 6 dec.
  No pBRL — replaced by pUSD per token catalog.
- MAINNET_RUNTIME_PRESET constant + wired in preset_names + get_preset.

Node / chain spec:
- mainnet_chain_spec(): ChainType::Live, id plim_mainnet_v2,
  protocol_id plim2, tokenSymbol=PLIM, ss58=42, empty boot_nodes.
- command.rs load_spec matches mainnet-v2 / plim_mainnet_v2.
- Existing mainnet-v1 on port 9946 is untouched (spec drift there
  is a separate concern).

Verified: `cargo check -p plim-runtime` -> clean
(finished 29.68s, 0 errors, only pre-existing stub-pallet warnings).

Deploy (when ready):
  cd plim-chain && cargo build --release -p plim-node \
    && plim-node build-spec --chain mainnet-v2 --raw \
       > chain-spec-mainnet-v2-raw.json

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
PlimIdentity (10): KYC register/verify/revoke
PlimMandates (12): recurring payment authorizations + try_consume hook
PlimChannels (13): minimal open/close (signature TODO)
PlimDelegation (14): autonomous agent daily-limit delegation
PlimCompliance (15): sanction list + regulated assets gate
PlimReputation (16): score map + admin award + rate-limited peer attest
PlimTimestamps (17): content hash anchoring (for Natali quests, AIFSACCT)

mainnet_genesis(): 1B PLIM total — 600M treasury, 200M team vesting,
                   200M reserve, 1k sudo gas. 4 assets pre-created with
                   sudo admin (pEUR, pUSD, ePL, gPLIM).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Two compile errors blocked the v2 build:

1. `AttestCooldown: Get<BlockNumberFor<Self>>` couldn't accept ConstU32 in
   the runtime impl — Rust couldn't unify ConstU32<N> with BlockNumberFor<Self>
   through the trait bound. Fix: declare as Get<u32> and cast at use site
   via .into(). Same fix applied to PlimDelegation::BlocksPerDay.

2. `saturating_sub` on BlockNumberFor<T> needed the Saturating trait
   imported. Added `use frame_support::sp_runtime::Saturating;` to both
   reputation and delegation pallets.

Verified: cargo build --release -p plim-node compiled clean in 1m55s.
build-spec --chain mainnet-v2 --raw produced a clean 1040781-byte
chain-spec-mainnet-v2-raw.json (sha256 5ff954c8...).

Mainnet v2 is now LIVE on port 9947, producing blocks every 6s,
genesis 0xf527ab78032c7e4d00e491b36e67a15723027a63571b2c10b9da4e6fa10ef631.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Bumps runtime spec_version 101 -> 102 and wires pallet-multisig 40.1.0 into
the runtime between pallet-assets (8) and PlimIdentity (10). All existing
pallet indices 0-8 and 10-17 are unchanged, so no storage migrations are
needed. The new pallet carries:

  - DepositBase       = 1 UNIT
  - DepositFactor     = UNIT / 20
  - MaxSignatories    = 16
  - BlockNumberProvider = System

This is the runtime-side prerequisite for the maintenance-window handover
documented in MULTISIG_SUDO_PLAN.md: after the upgrade lands, the current
single-key sudo calls Sudo::set_key(<3-of-5 multisig SS58>), and from that
point every privileged call requires 3 of the 5 cosigners generated on
2026-04-14 and stored in /root/SECURE/multisig_v1_2026-04-14/.

No chain-spec, node, or pallet changes. No recompile performed here — the
runtime will be built inside the maintenance window per the runbook.
Archive pre-v2 specs as .MOVED tombstones, promote v2 as active raw spec.
plim-node-mainnet-v2.service ExecStart already points at chain-spec-mainnet-v2-raw.json.

Secret scan (secretSeed/seed/suri): 0 matches in all JSONs and MAINNET_KEYS_BACKUP.md.MOVED.
Plaintext keys live only in /root/SECURE/ since 2026-04-13.

Docs: BOOTSTRAP_ROADMAP, CHAIN_SPEC_HARDENING, MAINNET_V2_DEPLOY, STATUS, TBD_DECISIONS, TOKEN_CATALOG.
@socket-security
Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedpallet-assets@​42.0.010010093100100

View full report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant