Skip to content

Commit

Permalink
add l2 gas support
Browse files Browse the repository at this point in the history
  • Loading branch information
ShahakShama committed Jan 7, 2025
1 parent e17853b commit 2dd7af3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
14 changes: 8 additions & 6 deletions p2p/proto/sync/header.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ message SignedBlockHeader {
Patricia events = 9; // By order of issuance. TBD: in receipts?
Hash receipts = 10; // By order of issuance. This is a patricia root. No need for length because it's the same length as transactions.
string protocol_version = 11; // Starknet version
Uint128 gas_price_fri = 12;
Uint128 gas_price_wei = 13;
Uint128 data_gas_price_fri = 14;
Uint128 data_gas_price_wei = 15;
L1DataAvailabilityMode l1_data_availability_mode = 16;
Uint128 l1_gas_price_fri = 12;
Uint128 l1_gas_price_wei = 13;
Uint128 l1_data_gas_price_fri = 14;
Uint128 l1_data_gas_price_wei = 15;
Uint128 l2_gas_price_fri = 16;
Uint128 l2_gas_price_wei = 17;
L1DataAvailabilityMode l1_data_availability_mode = 18;
// for now, we assume a small consensus, so this fits in 1M. Else, these will be repeated and extracted from this message.
repeated ConsensusSignature signatures = 17;
repeated ConsensusSignature signatures = 19;
// can be more explicit here about the signature structure as this is not part of account abstraction
}

Expand Down
3 changes: 2 additions & 1 deletion p2p/proto/sync/receipt.proto
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ message Receipt {
uint32 memory_holes = 3;
Felt252 l1_gas = 4;
Felt252 l1_data_gas = 5;
Felt252 total_l1_gas = 6;
Felt252 l2_gas = 6;
Felt252 total_l1_gas = 7;
}

message Common {
Expand Down
5 changes: 4 additions & 1 deletion p2p/proto/transaction.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ message ResourceLimits {

message ResourceBounds {
ResourceLimits l1_gas = 1;
ResourceLimits l2_gas = 2;
// This can be None only in transactions that don't support l2 gas.
// Starting from 0.14.0, MempoolTransaction and ConsensusTransaction shouldn't have None here.
optional ResourceLimits l1_data_gas = 2;
ResourceLimits l2_gas = 3;
}

message AccountSignature {
Expand Down

0 comments on commit 2dd7af3

Please sign in to comment.