Skip to content

Commit ed1364d

Browse files
apollo_storage: add fee_proposal to StorageBlockHeader
1 parent 094710e commit ed1364d

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

crates/apollo_storage/src/header.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ pub struct StorageBlockHeader {
109109
pub n_transactions: usize,
110110
/// The number of events in this block.
111111
pub n_events: usize,
112+
/// SNIP-35: proposer's oracle-derived recommended fee.
113+
pub fee_proposal: GasPrice,
112114
}
113115

114116
type BlockHashToNumberTable<'env> =
@@ -225,7 +227,7 @@ impl<Mode: TransactionKind> HeaderStorageReader for StorageTxn<'_, Mode> {
225227
timestamp: block_header.timestamp,
226228
l1_da_mode: block_header.l1_da_mode,
227229
starknet_version,
228-
fee_proposal: GasPrice::default(),
230+
fee_proposal: block_header.fee_proposal,
229231
},
230232
state_diff_commitment: block_header.state_diff_commitment,
231233
transaction_commitment: block_header.transaction_commitment,
@@ -323,6 +325,7 @@ impl HeaderStorageWriter for StorageTxn<'_, RW> {
323325
state_diff_length: block_header.state_diff_length,
324326
n_transactions: block_header.n_transactions,
325327
n_events: block_header.n_events,
328+
fee_proposal: block_header.block_header_without_hash.fee_proposal,
326329
};
327330

328331
headers_table.append(&self.txn, &block_number, &storage_block_header)?;
@@ -430,7 +433,7 @@ impl HeaderStorageWriter for StorageTxn<'_, RW> {
430433
timestamp: reverted_header.timestamp,
431434
l1_da_mode: reverted_header.l1_da_mode,
432435
starknet_version,
433-
fee_proposal: GasPrice::default(),
436+
fee_proposal: reverted_header.fee_proposal,
434437
},
435438
state_diff_commitment: reverted_header.state_diff_commitment,
436439
transaction_commitment: reverted_header.transaction_commitment,

crates/apollo_storage/src/serialization/serializers.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ auto_storage_serde! {
183183
pub state_diff_length: Option<usize>,
184184
pub n_transactions: usize,
185185
pub n_events: usize,
186+
pub fee_proposal: GasPrice,
186187
}
187188
pub struct BlockHeaderCommitments {
188189
pub transaction_commitment: TransactionCommitment,

crates/apollo_storage/src/test_instances.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ auto_impl_get_test_instance! {
4646
pub state_diff_length: Option<usize>,
4747
pub n_transactions: usize,
4848
pub n_events: usize,
49+
pub fee_proposal: GasPrice,
4950
}
5051

5152
struct EventIndex(pub TransactionIndex, pub EventIndexInTransactionOutput);

0 commit comments

Comments
 (0)