Quick fix

This commit is contained in:
vbuterin
2019-07-31 21:28:07 -04:00
committed by GitHub
parent b57aed2380
commit 52705f6fab

View File

@@ -500,9 +500,9 @@ def shard_block_transition(state: ShardState, beacon_state: BeaconState, block:
add_fee(state, beacon_state, proposer_index, Gwei(state.basefee * len(block.core.data) // SHARD_BLOCK_SIZE_LIMIT))
QUOTIENT = SHARD_BLOCK_SIZE_LIMIT * BASEFEE_ADJUSTMENT_FACTOR
if len(block.core.data) > SHARD_BLOCK_SIZE_TARGET:
state.basefee += Gwei(min(1, state.basefee * (len(block.core.data) - SHARD_BLOCK_SIZE_TARGET) // QUOTIENT))
state.basefee += Gwei(max(1, state.basefee * (len(block.core.data) - SHARD_BLOCK_SIZE_TARGET) // QUOTIENT))
elif len(block.core.data) < SHARD_BLOCK_SIZE_TARGET:
state.basefee -= Gwei(min(1, state.basefee * (len(block.core.data) - SHARD_BLOCK_SIZE_TARGET) // QUOTIENT))
state.basefee -= Gwei(max(1, state.basefee * (len(block.core.data) - SHARD_BLOCK_SIZE_TARGET) // QUOTIENT))
state.basefee = Gwei(max(
1,
min(