Closed natebeauregard closed 3 weeks ago
@natebeauregard when creating the proto message, should we use proto default types? i.e, bytes
for common.Address
, bytes
for big.Int
Something like this:
message L1BlockInfo {
uint64 number = 1;
uint64 time = 2;
bytes base_fee = 3; // big.Int
bytes block_hash = 4; // common.Hash
uint64 sequence_number = 5; // Number of L2 blocks since the start of the epoch
bytes batcher_addr = 6; // common.Address, version 0 is just the address with 0 padding to the left
bytes l1_fee_overhead = 7; // eth.Bytes32, ignored after Ecotone upgrade
bytes l1_fee_scalar = 8; // eth.Bytes32, ignored after Ecotone upgrade
bytes blob_base_fee = 9; // big.Int, added by Ecotone upgrade
uint32 base_fee_scalar = 10; // added by Ecotone upgrade
uint32 blob_base_fee_scalar = 11; // added by Ecotone upgrade
}
@Jesserc Thanks for taking this on. Yeah let's just use scalars where they match up or bytes if there isn't a scalar to represent the value.
Currently, we use json marshaling when adding
L1BlockInfo
to thex/rollup
store.To improve marshal size and performance we should create a new proto message for L1BlockInfo and use protobuf marshaling to marshal the block info to binary.