Spec is described here https://www.notion.so/polytopelabs/Optimism-Support-for-Beacon-Consensus-Client-03a82c7b85404435b48f1a8e93b02722
This task specs out requirements for adding optimism support to the sync committee updates
We create a new struct that contains the LightClientUpdate alongside an optional optimism update field optimism_payload that holds Option as defined below.
struct BeaconClientUpdate {
pub consensus_update: LightClientUpdate,
pub optimism_payload: Option<OptimismPayloadProof>
}
struct OptimismPayloadProof {
/// Actual state root of the optimism execution layer
pub state_root: [u8; 32],
/// Storage root hash of the optimism withdrawal contracts
pub withdrawal_storage_root: [u8; 32],
/// Optimism Block hash at which the values aboved were fetched
pub l2_block_hash: [u8; 32],
/// L2Oracle contract version
pub version: [u8; 32],
/// Membership Proof for the L2Oracle contract account in the ethereum world trie
pub l2_oracle_proof: Vec<Vec<u8>>,
/// Membership proof for Output root in l2Outputs array
pub output_root_proof: Vec<Vec<u8>>,
/// Index of the output root that needs to be proved in the l2Outputs array
pub output_root_index: u64
}
Contract Properties
For testnet L2Oracle contract address is 0x47bBB9054823f27B9B6A71F5cb0eBc785692FF2E
Slot index for the l2Outputs array in the contract is 3
To verify an optimism update
- Extract
L2Oracle
storage root hash from the l2_oracle_proof
, the root hash to be used for this step is the execution_payload_root
from the LightClientUpdate
.
- Use the extracted storage root hash to verify membership for the
output_root
as constructed below in the output_root_proof
Contract Properties
For testnet L2Oracle contract address is `0x47bBB9054823f27B9B6A71F5cb0eBc785692FF2E`
Slot index for the l2Outputs array in the contract is `3`
To verify an optimism update
1. Extract `L2Oracle` storage root hash from the `l2_oracle_proof` , the root hash to be used for this step is the `execution_payload_root` from the `LightClientUpdate`.
2. Use the extracted storage root hash to verify membership for the `output_root` as constructed below in the `output_root_proof`
Create a file for exporting beacon consensus client constants.
Feature flag testnet config parameters.