-
Notifications
You must be signed in to change notification settings - Fork 203
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
Revert "bump nim-web3 to enforce JSON-RPC Quantity syntax" #3850
Conversation
This reverts commit 007dcc4.
https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbyhash and https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbynumber lists/reference a
Nimbus currently does implement such a field in its The related (but potentially distinct) https://github.com/ethereum/execution-apis/blob/main/src/engine/specification.md#executionpayloadv1 lists
https://github.com/ethereum/execution-apis/blob/main/src/eth/block.yaml presents itself, and that GitHub repo is linked from ethereum.org/docs, as the authoritative source, and according to it, both
Following that link: https://github.com/ethereum/execution-apis/blob/main/src/schemas/block.yaml defines what it explicitly entitles a "Block object". This "Block object" that's returned by |
Part 2: https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbyhash (which also defines
They're both
https://github.com/ethereum/execution-apis/blob/main/src/schemas/block.yaml states that
First, they're not the same:
Furthermore, |
Part 3, unformatted data/ https://ethereum.org/en/developers/docs/apis/json-rpc/#unformatted-data-encoding states that
in particular, "two hex digits per byte". This appears to be the requirement placed on all of the
These fields in https://github.com/ethereum/execution-apis/blob/main/src/schemas/block.yaml are specified as one of:
with reference to https://github.com/ethereum/execution-apis/blob/main/src/schemas/base-types.yaml which defines their regexes fine for fixed-length types, e.g.,
for a 20-byte binary blob, which implies the two hex digits per byte, but for variable-length types,
allows for, say, |
* bearssl: use master branch again * chronos: less Option, better contenttype handling * eth, presto: less imports * stew: typo * web3: tighter `Quantity` parsing rules (see #3850 and subsequently status-im/nim-web3#55)
* bearssl: use master branch again * chronos: less Option, better contenttype handling * eth, presto: less imports * stew: typo * web3: tighter `Quantity` parsing rules (see #3850 and subsequently status-im/nim-web3#55)
Reverts #3846
Correct as far as it goes, but
https://github.com/status-im/nim-web3/blob/ae12813602b55d022d99d06d3cabc8f9425d62d6/web3/ethtypes.nim#L90-L111
and some other things in
ethtypes
define certain fields asQUANTITY
which are not, such as thenonce
field ofBlockObject
(return type ofgetBlockBy...
).Revert for now, until another pull of a more complete transformation of
nim-web3
ethtypes
corrects relevant types.