Split the verification that needs CommonParams and doesn't need it#1546
Merged
mergify[bot] merged 9 commits intoCodeChain-io:masterfrom May 21, 2019
sgkim126:veri
Merged
Split the verification that needs CommonParams and doesn't need it#1546mergify[bot] merged 9 commits intoCodeChain-io:masterfrom sgkim126:veri
mergify[bot] merged 9 commits intoCodeChain-io:masterfrom
sgkim126:veri
Conversation
Contributor
Author
|
It depends on #1545 |
Merged
majecty
reviewed
May 20, 2019
rpc/src/v1/impls/chain.rs
Outdated
|
|
||
| fn get_min_transaction_fee(&self, action_type: String, block_number: u64) -> Result<Option<u64>> { | ||
| if let Some(common_parameters) = self.client.common_params(Some(block_number)) { | ||
| if let Some(common_parameters) = self.client.common_params(block_number.into()) { |
There was a problem hiding this comment.
Should we use parent's block common params?
If the RPC's caller wants to fee to creates transactions in the next block, the current implementation is OK.
However, if the RPC's caller wants to check the block's min_fee to verify the block, we should use the previous block's common params.
Contributor
Author
There was a problem hiding this comment.
I made it use the parameters of the parent block.
HoOngEe
reviewed
May 20, 2019
foriequal0
requested changes
May 20, 2019
…t block Currently, CommonParams is immutable, but the next patch will make it changeable. So we need to check it on the parent states.
After introducing ChangeParams, common_params should return None, when the block is not executed yet.
Currently, CodeChainMachine manages the CommonParams, but it's fragile on reogranization. This patch makes CodeChainMachine has only the genesis parameters and the engine read the parameters from states.
foriequal0
approved these changes
May 21, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It's to ready the ChangeParams.
The current code assumes that the CommonParams are immutable.