Skip to content

Commit

Permalink
refactor: undo gas_limit renaming (#9558)
Browse files Browse the repository at this point in the history
Chunk header `gas_limit` was renamed to `prev_gas_limit` in
#9500. After discussion with
@jakmeier I've realised while it is determined in the previous chunk, it
actually corresponds to gas limit for the current chunk.
  • Loading branch information
pugachAG authored and nikurt committed Oct 2, 2023
1 parent dbc89af commit d9dc5cc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion chain/client/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2351,7 +2351,7 @@ pub fn create_chunk(
header.shard_id(),
&mut rs,
header.prev_gas_used(),
header.prev_gas_limit(),
header.gas_limit(),
header.prev_balance_burnt(),
tx_root,
header.prev_validator_proposals().collect(),
Expand Down
20 changes: 10 additions & 10 deletions core/primitives/src/sharding/shard_chunk_header_inner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ impl ShardChunkHeaderInner {
}

#[inline]
pub fn prev_gas_limit(&self) -> Gas {
pub fn gas_limit(&self) -> Gas {
match self {
Self::V1(inner) => inner.prev_gas_limit,
Self::V2(inner) => inner.prev_gas_limit,
Self::V3(inner) => inner.prev_gas_limit,
Self::V1(inner) => inner.gas_limit,
Self::V2(inner) => inner.gas_limit,
Self::V3(inner) => inner.gas_limit,
}
}

Expand Down Expand Up @@ -144,8 +144,8 @@ pub struct ShardChunkHeaderInnerV1 {
pub shard_id: ShardId,
/// Gas used in the previous chunk.
pub prev_gas_used: Gas,
/// Gas limit voted by validators in the previous chunk.
pub prev_gas_limit: Gas,
/// Gas limit voted by validators.
pub gas_limit: Gas,
/// Total balance burnt in the previous chunk.
pub prev_balance_burnt: Balance,
/// Previous chunk's outgoing receipts merkle root.
Expand All @@ -171,8 +171,8 @@ pub struct ShardChunkHeaderInnerV2 {
pub shard_id: ShardId,
/// Gas used in the previous chunk.
pub prev_gas_used: Gas,
/// Gas limit voted by validators in the previous chunk.
pub prev_gas_limit: Gas,
/// Gas limit voted by validators.
pub gas_limit: Gas,
/// Total balance burnt in the previous chunk.
pub prev_balance_burnt: Balance,
/// Previous chunk's outgoing receipts merkle root.
Expand All @@ -198,8 +198,8 @@ pub struct ShardChunkHeaderInnerV3 {
pub shard_id: ShardId,
/// Gas used in the previous chunk.
pub prev_gas_used: Gas,
/// Gas limit voted by validators in the previous chunk.
pub prev_gas_limit: Gas,
/// Gas limit voted by validators.
pub gas_limit: Gas,
/// Total balance burnt in the previous chunk.
pub prev_balance_burnt: Balance,
/// Previous chunk's outgoing receipts merkle root.
Expand Down

0 comments on commit d9dc5cc

Please sign in to comment.