Skip to content

Plataberget test deployment #22696

Closed
Closed

Description

@maurelian

Description

  • Bootstrap the OPCM and deploy a new L1 chain to the Plataberget (Glamsterdam) testnet.
  • Test a deposit, and withdrawal path

Activity

  1. self-assigned this
    on Aug 28, 2026
  2. maurelian commented on Aug 28, 2026

    @maurelian
    ContributorAuthor

    The following Claude written summary outlines how we deployed the contracts to Plataberget and tested the deposit/withdrawal flow.

    As we did not have a full fledged devnet (ie. no L2 nodes, etc), the withdrawal test impersonated the proposer created a permissioned game, fast forwarded the chain and finalized the withdrawal.


    Deployed a fresh chain (L2 chain ID 78216) to glamsterdam-devnet-8 ("Plataberget", L1 chain ID 7091047534) with op-deployer built from jm/glamsterdam-test, then exercised the full deposit → prove → finalize withdrawal lifecycle (finalization rehearsed on an anvil fork; the real withdrawal matures 2026-09-02).

    Commands run (2026-08-26)

    All cast/op-deployer traffic ran through a local logging proxy at http://127.0.0.1:18545 that forwards to https://rpc.glamsterdam-devnet-8.ethpandaops.io/ with a curl user-agent and retries on 502 — Cloudflare 502s cast's own user-agent.

    Deployment

    just build

    Builds the contracts, embeds the branch's forge artifacts into op-deployer, and builds bin/op-deployer. Two Go fixes were needed on the branch first (op-deployer: trust the node-reported fork block hash, op-deployer: pad broadcast gas limits for unmodeled state gas).

    ./bin/op-deployer bootstrap superchain \
        --l1-rpc-url http://127.0.0.1:18545 \
        --artifacts-locator embedded \
        --superchain-proxy-admin-owner $EOA --guardian $EOA \
        --no-verify --outfile .deployer/bootstrap_superchain.json

    Deploys SuperchainConfig (impl + proxy) and the superchain ProxyAdmin — required on a fresh L1 before implementations can be bootstrapped.

    ./bin/op-deployer bootstrap implementations \
        --l1-rpc-url http://127.0.0.1:18545 \
        --artifacts-locator embedded \
        --superchain-config-proxy 0xbbed762e39bc32b12dac0d9e2f0fc5ffa9c054ef \
        --superchain-proxy-admin 0x6579cabfcf54327c3195f3b4a1fa2f15e18251b9 \
        --upgrade-controller $EOA --challenger $EOA \
        --no-verify --outfile .deployer/bootstrap_implementations.json

    Deploys all implementation contracts plus the OPCM. The OptimismPortal impl needed 35.4M gas (EIP-8037 state gas), fine under reservoir semantics since the execution portion stays below the EIP-7825 cap.

    ./bin/op-deployer init --intent-type custom --l1-chain-id 7091047534 \
        --l2-chain-ids 78216 --workdir .deployer/plataberget
    ./bin/op-deployer apply --l1-rpc-url http://127.0.0.1:18545 --workdir .deployer/plataberget

    Creates the intent (then hand-edited: opcmAddress from the bootstrap output, all roles = the EOA, standard EIP-1559 params — full file below) and deploys the chain through the OPCM — proxies, super permissioned dispute game, L2 genesis.

    cast call $VALIDATOR 'validate((address,bytes32,uint256,address),bool)(string)' \
      "($SYSCFG,0x0,78216,$EOA)" true

    Runs the deployed OPCMStandardValidator against the new chain. Returned only SCKDG-SHAPE,SCKDG-10 (no permissionless super game registered — expected, apply is permissioned-only).

    Withdrawal parameter construction

    WHASH=$(cast keccak $(cast abi-encode 'f(uint256,address,address,uint256,uint256,bytes)' 0 $EOA $EOA 500000000000000000 100000 0x))

    Computes the withdrawal hash exactly as Hashing.hashWithdrawal does: keccak of the ABI-encoded (nonce, sender, target, value, gasLimit, data) tuple.

    SKEY=$(cast keccak $(cast abi-encode 'f(bytes32,uint256)' $WHASH 0))
    SECKEY=$(cast keccak $SKEY)

    Derives the L2ToL1MessagePasser storage slot for sentMessages[withdrawalHash] (mapping at slot 0), then the secure-trie path (keccak of the slot) used as the MPT key.

    LEAF=0xe3a120${SECKEY#0x}01
    SROOT=$(cast keccak $LEAF)

    Hand-encodes a single-leaf Merkle-Patricia trie: RLP list of the hex-prefix-encoded 64-nibble path and value 0x01. Its keccak is the message passer storage root, and the leaf itself is the entire inclusion proof.

    OUTROOT=$(cast keccak $(cast abi-encode 'f(bytes32,bytes32,bytes32,bytes32)' 0x0000000000000000000000000000000000000000000000000000000000000000 $SR $SROOT $BH))

    Builds the output root per Hashing.hashOutputRootProof from (version 0, arbitrary state root, our storage root, arbitrary block hash).

    EXTRA=0x01${TSHEX}${CID}${OUTROOT#0x}
    CLAIM=$(cast keccak $EXTRA)

    Encodes the super-root preimage (0x01 ‖ uint64 timestamp ‖ uint256 chainId ‖ outputRoot) used as the game's extraData; its keccak is the game's root claim.

    Deposit (real devnet)

    cast send $PORTAL "depositTransaction(address,uint256,uint64,bool,bytes)" \
      $EOA 1000000000000000000 100000 false 0x --value 1ether --private-key $PRIVATE_KEY

    Deposits 1 ETH through the OptimismPortal (emits TransactionDeposited); the ETH funds the portal so the later withdrawal payout has liquidity. Tx: 0xb22bbade8131cc04ee02cf1b82d8be43c6771abf38412ce5addc0ffe05bb7a20.

    Fork rehearsal (anvil)

    anvil --fork-url http://127.0.0.1:18545 --port 8546
    cast rpc anvil_impersonateAccount $EOA

    Forks the devnet locally and unlocks the EOA so fork transactions need no key. (Note: anvil executes cancun gas semantics under an Amsterdam label — fine here, since this tests contract logic, not gas.)

    cast call $DGF 'initBonds(uint32)(uint256)' 5
    cast call $PORTAL 'proofMaturityDelaySeconds()(uint256)'
    cast call $ASR 'disputeGameFinalityDelaySeconds()(uint256)'

    Reads the game bond (0) and the two delays gating finalization (7 days proof maturity, 3.5 days game finality).

    cast send $DGF 'create(uint32,bytes32,bytes)' 5 $CLAIM $EXTRA --from $EOA --unlocked

    Creates the SUPER_PERMISSIONED dispute game carrying the synthetic super root. This game type resolves DEFENDER_WINS at creation.

    cast send $PORTAL 'proveWithdrawalTransaction((uint256,address,address,uint256,uint256,bytes),uint256,(bytes32,bytes32,bytes32,bytes32),bytes[])' \
      "(0,$EOA,$EOA,500000000000000000,100000,0x)" 0 \
      "(0x0000000000000000000000000000000000000000000000000000000000000000,$STATE_ROOT,$STORAGE_ROOT,$BLOCK_HASH)" "[$LEAF]" --from $EOA --unlocked

    Proves the withdrawal against game index 0: the portal verifies the output-root preimage against the game's per-chain root claim and the MPT inclusion proof against the storage root.

    cast rpc evm_increaseTime 608400 && cast rpc evm_mine
    cast send $PORTAL 'finalizeWithdrawalTransaction((uint256,address,address,uint256,uint256,bytes))' \
      "(0,$EOA,$EOA,500000000000000000,100000,0x)" --from $EOA --unlocked

    Fast-forwards 7 days + 1 hour (covering both delays) and finalizes; verified EOA +0.5 ETH, portal −0.5 ETH, finalizedWithdrawals[hash] = true, and a second finalize reverts OptimismPortal_AlreadyFinalized.

    Queue on the real devnet

    cast send $DGF 'create(uint32,bytes32,bytes)' 5 $CLAIM $EXTRA --private-key $PRIVATE_KEY
    cast send $PORTAL 'proveWithdrawalTransaction(…)' … --private-key $PRIVATE_KEY

    Same create and prove as the rehearsal, but signed and sent to the live devnet — starting the real 7-day maturity clock (game create 0x055aaa4ab8ad541f6613e380e7eec3ca2d0932e28360c07479b829298809cc86, prove 0x778b5f6481204e8d2bc6278cc0d20ac871befbe088b33a155999d99303adfb62). Finalize is runnable from unix 1788397584 (≈ 2026-09-02):

    cast send $PORTAL 'finalizeWithdrawalTransaction((uint256,address,address,uint256,uint256,bytes))' \
      "(0,$EOA,$EOA,500000000000000000,100000,0x)" --private-key $PRIVATE_KEY \
      -r https://rpc.glamsterdam-devnet-8.ethpandaops.io/

    Inputs needed to re-execute

    Prerequisites: branch jm/glamsterdam-test (includes the two op-deployer fixes above), a funded EOA on glamsterdam-devnet-8, foundry's cast/anvil, and a UA-spoofing proxy in front of the public RPC (or equivalent retries).

    .deployer/plataberget/intent.toml — the only hand-edited op-deployer input (bootstrap takes everything via flags; opcmAddress comes from the bootstrap implementations outfile):

    configType = "custom"
    opDeployerVersion = "untagged-4352427a-1787692214"
    l1ChainID = 7091047534
    fundDevAccounts = true
    l1ContractsLocator = "embedded"
    l2ContractsLocator = "embedded"
    useInterop = false
    opcmAddress = "0xe37ab5102751d16db3835cf8dceb4f53e4783270"
    
    [[chains]]
      id = "0x0000000000000000000000000000000000000000000000000000000000013188"
      baseFeeVaultRecipient = "0xA6aFc9612b504202E0A5F6cf3C8E89C49EA06037"
      l1FeeVaultRecipient = "0xA6aFc9612b504202E0A5F6cf3C8E89C49EA06037"
      sequencerFeeVaultRecipient = "0xA6aFc9612b504202E0A5F6cf3C8E89C49EA06037"
      operatorFeeVaultRecipient = "0xA6aFc9612b504202E0A5F6cf3C8E89C49EA06037"
      eip1559DenominatorCanyon = 250
      eip1559Denominator = 50
      eip1559Elasticity = 6
      gasLimit = 60000000
      operatorFeeScalar = 0
      operatorFeeConstant = 0
      minBaseFee = 0
      daFootprintGasScalar = 0
      [chains.roles]
        l1ProxyAdminOwner = "0xA6aFc9612b504202E0A5F6cf3C8E89C49EA06037"
        l2ProxyAdminOwner = "0xA6aFc9612b504202E0A5F6cf3C8E89C49EA06037"
        systemConfigOwner = "0xA6aFc9612b504202E0A5F6cf3C8E89C49EA06037"
        unsafeBlockSigner = "0xA6aFc9612b504202E0A5F6cf3C8E89C49EA06037"
        batcher = "0xA6aFc9612b504202E0A5F6cf3C8E89C49EA06037"
        proposer = "0xA6aFc9612b504202E0A5F6cf3C8E89C49EA06037"
        challenger = "0xA6aFc9612b504202E0A5F6cf3C8E89C49EA06037"
      [chains.customGasToken]
        liquidityControllerOwner = "0x0000000000000000000000000000000000000000"

    .deployer/plataberget/withdrawal/params.env — every value the withdrawal commands reference (all derivable from the construction commands above; recorded here so the exact live-chain withdrawal can be finalized/inspected):

    EOA=0xA6aFc9612b504202E0A5F6cf3C8E89C49EA06037
    WHASH=0x0636afe2413970b4ef980b7b13b121ac7606dd860e3e3dec51a1614101548dda
    STORAGE_KEY=0x18414efa574a8b391640e4b9cfc12c54ae84b585630e1459997ef086e3b2a6b1
    LEAF=0xe3a120b35ce15af4b25f8b76ecae4ae7152f5346ebfa70a398d87d66353425d51ae69d01
    STORAGE_ROOT=0xf949580aa6feb418b8f8df61c119bc5e788688e85b9d4a214d8ee8783cadb716
    STATE_ROOT=0x1111111111111111111111111111111111111111111111111111111111111111
    BLOCK_HASH=0x2222222222222222222222222222222222222222222222222222222222222222
    OUTPUT_ROOT=0xc70d36ad7c182a97694a6e7abeb54865d43d6b4829c4ad3012abea2acb0cd5d2
    TS=1787792373
    EXTRA=0x01000000006a8f8bf50000000000000000000000000000000000000000000000000000000000013188c70d36ad7c182a97694a6e7abeb54865d43d6b4829c4ad3012abea2acb0cd5d2
    CLAIM=0x2d15e4e5adc9ae1c0cfeefe40235d410e92eb1e35b5341b126d8478f41aed901
    PORTAL=0x78f621e7fc2477ca3b653c6b48ce064d27d06001
    DGF=0xc42a7728a0599350aaa3d36ceac97828b48eea51
    ASR=0xfc736860fcf7c81993767bd641fdfb90613be509

    Other addresses referenced: VALIDATOR=0x46bee3284bc41691752e20a99116c43917e383ec (OPCMStandardValidator), SYSCFG=0xba443c19dc92a8d1f15923bf8f8b0f525047179d (SystemConfig proxy). The full deployment address set is in the op-deployer outfiles (bootstrap_superchain.json, bootstrap_implementations.json, plataberget/state.json).

    Caveat: the game's super root is synthetic (hand-built single-leaf message passer trie; no real L2 exists). Once it finalizes in the AnchorStateRegistry it becomes the anchor for future games on this chain — fine for a throwaway test chain.

  3. maurelian commented on Aug 28, 2026

    @maurelian
    ContributorAuthor

    Also running the StandardValidator:

    cast call 0x46bee3284bc41691752e20a99116c43917e383ec \
                         'validate((address,bytes32,uint256,address),bool)(string)' \
                         '(0xba443c19dc92a8d1f15923bf8f8b0f525047179d,0x0000000000000000000000000000000000000000000000000000000000000000,78216,0xA6aFc9612b504202E0A5F6cf3C8E89C49EA06037)' \
                         true -r http://127.0.0.1:18545
    "SCKDG-SHAPE,SCKDG-10"
    

    SCKDG-SHAPE,SCKDG-10 are OK, because the permissionless super game is absent.

    • SCKDG-10 — no implementation registered in the DGF for that game type
    • SCKDG-SHAPE — its gameArgs are empty/malformed (trivially true when the game was never registered)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions