-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Eth JSON-RPC: populate reward in eth_feeHistory #10245
Conversation
b47bec4
to
bd2bd3a
Compare
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.
Itests fail
eth_fee_history_test.go:55:
Error Trace: /home/circleci/project/itests/eth_fee_history_test.go:55
Error: Not equal:
expected: 17
actual : 16
Test: TestEthFeeHistory
blockminer.go:362: shutting down mining
blockminer.go:362: shutting down mining
--- FAIL: TestEthFeeHistory (9.00s)
bd2bd3a
to
c3ee054
Compare
Co-authored-by: Łukasz Magiera <[email protected]>
c3ee054
to
b43be25
Compare
availablePriorityFee := big.Sub(big.Int(tx.MaxFeePerGas), blkBaseFee) | ||
if big.Cmp(big.Int(tx.MaxPriorityFeePerGas), availablePriorityFee) <= 0 { | ||
return tx.MaxPriorityFeePerGas | ||
} | ||
return EthBigInt(availablePriorityFee) | ||
} |
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 rewrote this a little to make it nicer to read.
node/impl/full/eth.go
Outdated
var totalGasUsed uint64 | ||
for _, tx := range txGasRewards { | ||
totalGasUsed += tx.gas | ||
} | ||
|
||
rewards := make([]ethtypes.EthBigInt, len(rewardPercentiles)) | ||
for i := range rewards { | ||
rewards[i] = ethtypes.EthBigIntZero | ||
} | ||
|
||
if len(txGasRewards) == 0 { | ||
return rewards, totalGasUsed | ||
} | ||
|
||
sort.Sort(txGasRewards) | ||
|
||
var idx int |
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.
Also adjusted the logic here so that it's easier to follow.
Related Issues
#10236
Proposed Changes
Additional Info
Checklist
Before you mark the PR ready for review, please make sure that:
<PR type>: <area>: <change being made>
fix: mempool: Introduce a cache for valid signatures
PR type
: fix, feat, build, chore, ci, docs, perf, refactor, revert, style, testarea
, e.g. api, chain, state, market, mempool, multisig, networking, paych, proving, sealing, wallet, deps