-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Allow default block parameter to be blockHash #10932
Conversation
It looks like @seunlanlege signed our Contributor License Agreement. 👍 Many thanks, Parity Technologies CLA Bot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. (requireCanonical
is lacking for a full EIP-1898 support)
let s = r#""10""#; | ||
assert!(serde_json::from_str::<BlockNumber>(s).is_err()); | ||
fn should_not_deserialize() { | ||
let s = r#"[{}, "10"]"#; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we reject requireCanonical
with BlockNumber
or any other invalid combinations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, the code does not reject if used with blockNumber
instead it is ignored. Do you think we should reject?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if we derive Serialize/Deserialize
(seems possible with serde attributes) instead of manually implementing it, it would be automatically supported. This can be done in a separate PR though.
* master: journaldb changes (#10929) Allow default block parameter to be blockHash (#10932) Enable sealing when engine is ready (#10938) Fix some warnings and typos. (#10941) Updated security@parity.io key (#10939) Change the return type of step_inner function. (#10940) get rid of hidden mutability of Spec (#10904) simplify BlockReward::reward implementation (#10906) Kaspersky AV whitelisting (#10919) additional arithmetic EVM opcode benchmarks (#10916) [Cargo.lock] cargo update -p crossbeam-epoch (#10921) Fixes incorrect comment. (#10913) Add file path to disk map write/read warnings (#10911)
@@ -233,6 +233,8 @@ pub trait BlockChainClient : Sync + Send + AccountData + BlockChain + CallContra | |||
.expect("code will return Some if given BlockId::Latest; qed") | |||
} | |||
|
|||
fn chain(&self) -> Arc<BlockProvider>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That triggered another compiler warning for me:
warning: missing documentation for a trait method
--> ethcore/src/client/traits.rs:236:2
|
236 | fn chain(&self) -> Arc<BlockProvider>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: lint level defined here
--> ethcore/src/lib.rs:17:9
|
17 | #![warn(missing_docs, unused_extern_crates)]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, missed this during review. I added docs in another PR so it'll sort itself out soon enough.
* master: [evmbin] fix compilation (#10976) Update to latest trie version. (#10972) [blooms-db] Fix benchmarks (#10974) Fix ethcore/benches build. (#10964) tx-pool: accept local tx with higher gas price when pool full (#10901) Disable unsyncable expanse chain (#10926) Extract Machine from ethcore (#10949) removed redundant state_root function from spec, improve spec error types (#10955) Add support for Energy Web Foundation's new chains (#10957) [evmbin] add more tests to main.rs (#10956) Fix compiler warnings in util/io and upgrade to edition 2018 Upgrade mio to latest (#10953) unify loading spec && further spec cleanups (#10948) refactor: Refactor evmbin CLI (#10742) journaldb changes (#10929) Allow default block parameter to be blockHash (#10932) Enable sealing when engine is ready (#10938) Fix some warnings and typos. (#10941) Updated security@parity.io key (#10939) Change the return type of step_inner function. (#10940)
* allow default block parameter to be blockHash * requireCanonical * block check takes precedence over canon check
It's been nearly 4 months since this got merged. When is it going to be released? Geth support is already out. |
Is it not in the latest beta? |
@fabioberger @dvdplm It is included in v2.6.5 beta EDIT: I forgot to add it in the PR description and thus it's missing in the CHANGELOG. |
Thanks @niklasad1! 🙏 Any estimates on when it'll make it into the stable releases? |
@dvdplm any idea when this will make it into a stable release? I've seen several stable releases go out but none include these changes. |
Sorry late answer, I expect it to be included in |
Thanks for the reply @niklasad1. Any idea when |
@fabioberger It will be included EDIT: It is released, https://github.com/paritytech/parity-ethereum/releases/tag/v2.7.0 |
Since this is not part of OpenEthereum 3.1 history anymore, I backported this in openethereum/openethereum#70 |
Adds support for deserializing
blockHash
andblockNumber
as perEIP-1898
toBlockNumber
Closes #10567