Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better L2 block representation #1766

Open
eyusufatik opened this issue Jan 30, 2025 · 0 comments
Open

Better L2 block representation #1766

eyusufatik opened this issue Jan 30, 2025 · 0 comments
Milestone

Comments

@eyusufatik
Copy link
Member

We lack two things:

  1. No state root in the block header, so the hash of the block does not cover storage root.

    Right now the sequencer does not actually sign the state root, which might be problematic later on. We must include the state root in the header.

  2. No header / header + txs seperation → No sov-tx merkle root

    Having small data that tells somethings about the chain is good.
    Every chain that I'm aware of has

    Block = header + transactions

    That can become useful in many contexts.

With these changes the proposed header is as follows:

struct L2Header {
  l2_height: u64,
  prev_hash: [u8; 32],
  state_root: [u8; 32],
  // these two maybe removed or not
  // depending on system tx decision
  // da_slot_height: u64,
  // da_slot_hash: [u8; 32],
  // da_slot_txs_commitment: [u8; 32],
  l1_fee_rate: u128,
  tx_merkle_root: [u8; 32],
  // maybe removed due to 
  // deposit_data: Vec<Vec<u8>>,
  timestamp: u64,
}

struct SignedL2Header {
  header: SoftConfirmationHeader,
  hash: [u8; 32],
  signature: Vec<u8>,
}

struct L2Block {
  header: SignedSoftConfirmationHeader,
  txs: Vec<SovTx>,
}
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

No branches or pull requests

1 participant