• Mark Tyneway's avatar
    op-chain-ops: export bedrock transition block extradata · 1f258d90
    Mark Tyneway authored
    Makes the extradata for the bedrock transition block
    a public variable. This is useful for exporting the
    value to be imported in other packages where assertions
    can be made to ensure that the extradata is correct.
    
    When fetching the `L2OutputOracle`'s configured starting
    block number, the L2 block with that number can be
    fetched and then we can assert that it has the magic
    extradata.
    
    ```bash
    $ cast call 0x02Ac1923480E7fd234e7F2Fd11596b9F20372374 'startingBlockNumber()(uint256)'
    3855343
    ```
    
    ```bash
    $ cast block 3855343 --json | jq -r .extraData
    0x424544524f434b
    ```
    
    Now check like so:
    
    ```bash
    $ cast --to-ascii 0x424544524f434b
    BEDROCK
    ```
    1f258d90
check.go 9.42 KB