Skip to content
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

Use hexutil.Uint for blockCount parameter and oldestBlock result value in feeHistory method #23239

Merged
merged 4 commits into from
Jul 27, 2021

Conversation

lightclient
Copy link
Member

@lightclient lightclient commented Jul 20, 2021

The current spec uses an Integer type for the blockCount parameter and OldestBlock result value. The schema for these values define them to be a hex string.

(h/t @ryanschneider for finding)

Copy link
Contributor

@ryanschneider ryanschneider left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this will be a breaking change from 1.10.5 which was released with the previous behavior. I'm definitely torn on that.

@juanfranblanco
Copy link

H!i Also note that the "oldestBlock" in the output is also not Hex

Copy link
Member

@rjl493456442 rjl493456442 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just nitpicks.
@zsfelfoldi Please also check it, especially in the spec the OldestBlock type is rpc.BlockNumber but I think hexutil.Big is better since it can always be resolved.

eth/gasprice/feehistory.go Outdated Show resolved Hide resolved
eth/gasprice/feehistory.go Outdated Show resolved Hide resolved
internal/ethapi/api.go Show resolved Hide resolved
Copy link
Contributor

@zsfelfoldi zsfelfoldi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (after fixing a build failure in the tests)

@zsfelfoldi zsfelfoldi merged commit bbfa648 into ethereum:master Jul 27, 2021
@lightclient
Copy link
Member Author

@zsfelfoldi doh thanks for fixing the test.

@holiman holiman added this to the 1.10.7 milestone Jul 27, 2021
@holiman
Copy link
Contributor

holiman commented Jul 27, 2021

@zsfelfoldi don't forget to set the milestone when merging a PR

sidhujag pushed a commit to sidhujag/go-ethereum that referenced this pull request Jul 28, 2021
…thereum#23239)

* internal/ethapi/api: use hexutil.uint for blockCount parameter instead of int for feeHistory

* return hex value for oldestBlock instead of number

* return uint64 from oracle.resolveBlockRange

* eth/gasprice: fixed test

Co-authored-by: Zsolt Felfoldi <[email protected]>
@lightclient lightclient changed the title Use hexutil.Uint for blockCount parameter in feeHistory method Use hexutil.Uint for blockCount parameter and oldestBlock result value in feeHistory method Jul 30, 2021
Copy link

@Farzin3 Farzin3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

``>>> import hashlib

m = hashlib.sha256()
m.update(b"Nobody inspects")
m.update(b" the spammish repetition")
m.digest()
b'\x03\x1e\xdd}Ae\x15\x93\xc5\xfe\\x00o\xa5u+7\xfd\xdf\xf7\xbcN\x84:\xa6\xaf\x0c\x95\x0fK\x94\x06'
m.digest_size
32
m.block_size
64
متراکم تر:

hashlib.sha224(b"Nobody inspects the spammish repetition").hexdigest()
'a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2'``

@@ -87,8 +87,8 @@ type feeHistoryResult struct {
GasUsedRatio []float64 `json:"gasUsedRatio"`
}

func (s *PublicEthereumAPI) FeeHistory(ctx context.Context, blockCount int, lastBlock rpc.BlockNumber, rewardPercentiles []float64) (*feeHistoryResult, error) {
oldest, reward, baseFee, gasUsed, err := s.b.FeeHistory(ctx, blockCount, lastBlock, rewardPercentiles)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTC 1000000.01

@Farzin3
Copy link

Farzin3 commented Sep 2, 2021

">>> وارد کردن hashlib

m = hashlib.sha256 ()
m.update (b "کسی بازرسی نمی کند")
m.update (b "تکرار هرزنامه")
m.digest ()
b '\ x03 \ x1e \ xdd} Ae \ x15 \ x93 \ xc5 \ xfe \ x00o \ xa5u+7 \ xfd \ xdf \ xf7 \ xbcN \ x84: \ xa6 \ xaf \ x0c \ x95 \ x0fK \ x94 \ x06 '
m.digest_size
32
m.block_size
64
متراکم تر:

hashlib.sha224 (b "هیچ کس تکرار هرزنامه را بررسی نمی کند"). hexdigest ()

#'a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2 ""

atif-konasl pushed a commit to frozeman/pandora-execution-engine that referenced this pull request Oct 15, 2021
…thereum#23239)

* internal/ethapi/api: use hexutil.uint for blockCount parameter instead of int for feeHistory

* return hex value for oldestBlock instead of number

* return uint64 from oracle.resolveBlockRange

* eth/gasprice: fixed test

Co-authored-by: Zsolt Felfoldi <[email protected]>
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Aug 26, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 2, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 6, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 9, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 9, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 9, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 12, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 12, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 19, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 19, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 19, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 21, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 22, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 22, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 23, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 23, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 26, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 26, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 27, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Oct 9, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Oct 17, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Oct 18, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Oct 25, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Oct 25, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Oct 29, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Oct 30, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Oct 31, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Oct 31, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Nov 1, 2024
wanwiset25 pushed a commit to XinFinOrg/XDPoSChain that referenced this pull request Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants