Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "starknet: add l2 gas price header prop",
"packageName": "@apibara/starknet",
"email": "francesco@ceccon.me",
"dependentChangeType": "patch"
}
4 changes: 3 additions & 1 deletion packages/starknet/proto/data.proto
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ message BlockHeader {
ResourcePrice l1_data_gas_price = 9;
// L1 data availability mode.
L1DataAvailabilityMode l1_data_availability_mode = 10;
// Price of L2 gas in the block.
ResourcePrice l2_gas_price = 11;
}

// A transaction.
Expand Down Expand Up @@ -523,4 +525,4 @@ enum CallType {
CALL_TYPE_LIBRARY_CALL = 1;
CALL_TYPE_CALL = 2;
CALL_TYPE_DELEGATE = 3;
}
}
2 changes: 2 additions & 0 deletions packages/starknet/src/block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ export type DataAvailabilityMode = CodecType<typeof DataAvailabilityMode>;
* @prop l1GasPrice Calldata gas price.
* @prop l1DataGasPrice Blob gas price.
* @prop l1DataAvailabilityMode How data is posted to L1.
* @prop l2GasPrice L2 gas price.
*/
export const BlockHeader = MessageCodec({
blockHash: OptionalCodec(FieldElement),
Expand All @@ -194,6 +195,7 @@ export const BlockHeader = MessageCodec({
l1GasPrice: RequiredCodec(ResourcePrice),
l1DataGasPrice: RequiredCodec(ResourcePrice),
l1DataAvailabilityMode: RequiredCodec(L1DataAvailabilityMode),
l2GasPrice: OptionalCodec(ResourcePrice),
});

export type BlockHeader = Readonly<CodecType<typeof BlockHeader>>;
Expand Down
24 changes: 23 additions & 1 deletion packages/starknet/src/proto/data.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.