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

RPC: Fix and refactor gas fee and fee history RPCs #2788

Merged
merged 18 commits into from
Jan 24, 2024
Merged

Conversation

sieniven
Copy link
Member

@sieniven sieniven commented Jan 23, 2024

Summary

  1. Fixes to the eth_gasPrice RPC.
  • Aligns eth_gasPrice implementation to geth (Ref: https://github.com/ethereum/go-ethereum/blob/master/eth/gasprice/gasprice.go)
  • Fix error in old gasPrice pipeline that loops through current EVM block to the genesis block.
  • Enable passing of configurable percentile parameter for the block service in calculating suggested priority fee (default at 60%)
  • Add caching of the current tip's suggested fee per gas into block service.
  • Add test for eth_gasPrice -> renamed feature_evm_rpc_fee_history to feature_evm_rpc_fee which now includes suggested gas price calculations test.
  • Remove all unwraps and proper error handling.
  1. Fixes to the eth_feeHistory RPC.
  • Aligns eth_feeHistory implementation to geth (Ref: https://github.com/ethereum/go-ethereum/blob/master/eth/gasprice/feehistory.go)
  • Fix error when returning requested sampled rewards from reward percentile values. Previously the sampled rewards did not account for the transaction's gas used. This is fixed in this PR, that returns the sampled transactions' priority fees that is weighted by their gas usage.
  1. Housekeeping:
  • Proper error handling in logevmaccontstate debug RPC and
  • Re-enable correct tx gas fee test.

Implications

  • Storage

    • Database reindex required
    • Database reindex optional
    • Database reindex not required
    • None
  • Consensus

    • Network upgrade required
    • Includes backward compatible changes
    • Includes consensus workarounds
    • Includes consensus refactors
    • None

lib/ain-evm/src/evm.rs Outdated Show resolved Hide resolved
lib/ain-grpc/src/rpc/eth.rs Show resolved Hide resolved
@Bushstar Bushstar merged commit e2e04da into master Jan 24, 2024
15 of 16 checks passed
@Bushstar Bushstar deleted the niven/gas-price-rpc branch January 24, 2024 11:31
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.

None yet

3 participants