Skip to content

Commit

Permalink
fix: calc constants rather than hardcoding where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
Maddiaa0 committed Jul 27, 2023
1 parent 955ef6a commit ff21672
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions l1-contracts/src/core/libraries/Decoder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,14 @@ library Decoder {
// Where the start of trees metadata begins in the block
uint256 private constant START_TREES_BLOCK_HEADER_OFFSET = 0x80;

// Where the end of trees metadata begns in the block
uint256 private constant END_TREES_BLOCK_HEADER_OFFSET = 0x01c0;

// The size of the block header elements
uint256 private constant TREES_BLOCK_HEADER_SIZE = 0x140;

// Where the end of trees metadata begns in the block
uint256 private constant END_TREES_BLOCK_HEADER_OFFSET = START_TREES_BLOCK_HEADER_OFFSET + TREES_BLOCK_HEADER_SIZE;

// Where the metadata ends and the block data begins.
// This is really (START_TREES_BLOCK_HEADER_OFFSET + 2 * TREES_BLOCK_HEADER_SIZE) but assembly doesnt allow comptime constant use
uint256 private constant BLOCK_HEADER_OFFSET = 0x0300;

/**
Expand Down

0 comments on commit ff21672

Please sign in to comment.