-
Notifications
You must be signed in to change notification settings - Fork 659
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
post-state-root: implement block production #9618
Comments
My summary of necessary changes:
Not that necessary changes - we can remove challenges_root and challenges_result, as we don't plan to implement challenges anymore. We could consider the same about block_ordinal and epoch_sync_data_hash. Full fields description: BlockHeaderInnerLite
BlockHeaderInnerRestV5
|
After a bit of discussions, I think that there are no necessary fields to change. ExplanationValidator proposalsLet's stop caring about what's the name of the field. Focus on invariant instead, which is: Validator proposals must be applied at the same time to EpochManager (during add_validator_proposals) and State (during chunk processing)
So nothing changes here. With post-state-root, we can just pass proposals using chunk header itself (new Gas priceI assumed that in pre-state-root, for applying chunk, gas price is taken from the block which contains this chunk, as we already know the block. nearcore/chain/chain/src/chain.rs Line 4120 in 9c8d0bb
I don't know why. But in both pre and post state roots previous block exists anyway, so we can avoid any changes there. (@pugachAG: we can still just rename this field to next_gas_price to avoid further confusion)
|
Part of #9618. In post-state-root, chunk production is moved before block production, thus we don't have a `Block` during applying chunk anymore. We need to make sure that all necessary data is still propagated to `Runtime::apply`. It should've not have been an error for gas price, as it is taken from previous block in the general case: https://github.com/near/nearcore/blob/9c8d0bbec6a71876bb3317db2ade425f0077a184/chain/chain/src/chain.rs#L4120 However, when there is no chunk, there seem to be a very old error - it is taken from the same block. Luckily, after `ProtocolFeature::FixApplyChunks` it is not an issue: when there is no chunk, gas price is not used at all. So I just start taking it from previous block for consistency, to ensure that in post-state-root current block can be safely removed. Full context: https://near.zulipchat.com/#narrow/stream/295302-general/topic/.E2.9C.94.20gas.20price.20inconsistency/near/394894144 ## Testing As the change must be no-op, existing tests are enough.
Part of #9618. In post-state-root, chunk production is moved before block production, thus we don't have a `Block` during applying chunk anymore. We need to make sure that all necessary data is still propagated to `Runtime::apply`. It should've not have been an error for gas price, as it is taken from previous block in the general case: https://github.com/near/nearcore/blob/9c8d0bbec6a71876bb3317db2ade425f0077a184/chain/chain/src/chain.rs#L4120 However, when there is no chunk, there seem to be a very old error - it is taken from the same block. Luckily, after `ProtocolFeature::FixApplyChunks` it is not an issue: when there is no chunk, gas price is not used at all. So I just start taking it from previous block for consistency, to ensure that in post-state-root current block can be safely removed. Full context: https://near.zulipchat.com/#narrow/stream/295302-general/topic/.E2.9C.94.20gas.20price.20inconsistency/near/394894144 ## Testing As the change must be no-op, existing tests are enough.
Part of #9618. In post-state-root, chunk production is moved before block production, thus we don't have a `Block` during applying chunk anymore. We need to make sure that all necessary data is still propagated to `Runtime::apply`. It should've not have been an error for gas price, as it is taken from previous block in the general case: https://github.com/near/nearcore/blob/9c8d0bbec6a71876bb3317db2ade425f0077a184/chain/chain/src/chain.rs#L4120 However, when there is no chunk, there seem to be a very old error - it is taken from the same block. Luckily, after `ProtocolFeature::FixApplyChunks` it is not an issue: when there is no chunk, gas price is not used at all. So I just start taking it from previous block for consistency, to ensure that in post-state-root current block can be safely removed. Full context: https://near.zulipchat.com/#narrow/stream/295302-general/topic/.E2.9C.94.20gas.20price.20inconsistency/near/394894144 ## Testing As the change must be no-op, existing tests are enough.
Part of #9618. In post-state-root, chunk production is moved before block production, thus we don't have a `Block` during applying chunk anymore. We need to make sure that all necessary data is still propagated to `Runtime::apply`. It should've not have been an error for gas price, as it is taken from previous block in the general case: https://github.com/near/nearcore/blob/9c8d0bbec6a71876bb3317db2ade425f0077a184/chain/chain/src/chain.rs#L4120 However, when there is no chunk, there seem to be a very old error - it is taken from the same block. Luckily, after `ProtocolFeature::FixApplyChunks` it is not an issue: when there is no chunk, gas price is not used at all. So I just start taking it from previous block for consistency, to ensure that in post-state-root current block can be safely removed. Full context: https://near.zulipchat.com/#narrow/stream/295302-general/topic/.E2.9C.94.20gas.20price.20inconsistency/near/394894144 ## Testing As the change must be no-op, existing tests are enough.
Part of #9618. In post-state-root, chunk production is moved before block production, thus we don't have a `Block` during applying chunk anymore. We need to make sure that all necessary data is still propagated to `Runtime::apply`. It should've not have been an error for gas price, as it is taken from previous block in the general case: https://github.com/near/nearcore/blob/9c8d0bbec6a71876bb3317db2ade425f0077a184/chain/chain/src/chain.rs#L4120 However, when there is no chunk, there seem to be a very old error - it is taken from the same block. Luckily, after `ProtocolFeature::FixApplyChunks` it is not an issue: when there is no chunk, gas price is not used at all. So I just start taking it from previous block for consistency, to ensure that in post-state-root current block can be safely removed. Full context: https://near.zulipchat.com/#narrow/stream/295302-general/topic/.E2.9C.94.20gas.20price.20inconsistency/near/394894144 ## Testing As the change must be no-op, existing tests are enough.
Part of #9618. In post-state-root, chunk production is moved before block production, thus we don't have a `Block` during applying chunk anymore. We need to make sure that all necessary data is still propagated to `Runtime::apply`. It should've not have been an error for gas price, as it is taken from previous block in the general case: https://github.com/near/nearcore/blob/9c8d0bbec6a71876bb3317db2ade425f0077a184/chain/chain/src/chain.rs#L4120 However, when there is no chunk, there seem to be a very old error - it is taken from the same block. Luckily, after `ProtocolFeature::FixApplyChunks` it is not an issue: when there is no chunk, gas price is not used at all. So I just start taking it from previous block for consistency, to ensure that in post-state-root current block can be safely removed. Full context: https://near.zulipchat.com/#narrow/stream/295302-general/topic/.E2.9C.94.20gas.20price.20inconsistency/near/394894144 ## Testing As the change must be no-op, existing tests are enough.
Part of #9618. In post-state-root, chunk production is moved before block production, thus we don't have a `Block` during applying chunk anymore. We need to make sure that all necessary data is still propagated to `Runtime::apply`. It should've not have been an error for gas price, as it is taken from previous block in the general case: https://github.com/near/nearcore/blob/9c8d0bbec6a71876bb3317db2ade425f0077a184/chain/chain/src/chain.rs#L4120 However, when there is no chunk, there seem to be a very old error - it is taken from the same block. Luckily, after `ProtocolFeature::FixApplyChunks` it is not an issue: when there is no chunk, gas price is not used at all. So I just start taking it from previous block for consistency, to ensure that in post-state-root current block can be safely removed. Full context: https://near.zulipchat.com/#narrow/stream/295302-general/topic/.E2.9C.94.20gas.20price.20inconsistency/near/394894144 ## Testing As the change must be no-op, existing tests are enough.
Extend block production logic to support post-state-root version
The text was updated successfully, but these errors were encountered: