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

fix: eth API: correct gateway restrictions, drop unimplemented methods #10409

Merged
merged 3 commits into from
Mar 12, 2023

Conversation

arajasek
Copy link
Contributor

@arajasek arajasek commented Mar 7, 2023

Related Issues

  • The EthAPI was blanket using the stateLimiter for all endpoints, even chain / basic ones
  • The gateway supported unimplemented methods for no reason
  • The gateway was restricted lookback on methods that didn't need to be restricted (EthGetBlockTransactionCountByHash)

Discovered while investigating how to correctly restrict state lookbacks and computations for the EthAPI on the gateway.

Proposed Changes

  • Correct the limiter for all EthAPI endpoints
  • Drop unimplemented methods
  • Drop unnecessary restrictions on input height

Additional Info

Checklist

Before you mark the PR ready for review, please make sure that:

  • Commits have a clear commit message.
  • PR title is in the form of of <PR type>: <area>: <change being made>
    • example: fix: mempool: Introduce a cache for valid signatures
    • PR type: fix, feat, build, chore, ci, docs, perf, refactor, revert, style, test
    • area, e.g. api, chain, state, market, mempool, multisig, networking, paych, proving, sealing, wallet, deps
  • New features have usage guidelines and / or documentation updates in
  • Tests exist for new functionality or change in behavior
  • CI is green

@arajasek arajasek requested a review from a team as a code owner March 7, 2023 17:53
@arajasek arajasek requested review from raulk and ychiaoli18 March 7, 2023 17:53
@arajasek arajasek added this to the EthAPI refinements milestone Mar 8, 2023
Comment on lines -86 to -92
EthGetTransactionByBlockHashAndIndex(ctx context.Context, blkHash ethtypes.EthHash, txIndex ethtypes.EthUint64) (ethtypes.EthTx, error)
EthGetTransactionByBlockNumberAndIndex(ctx context.Context, blkNum ethtypes.EthUint64, txIndex ethtypes.EthUint64) (ethtypes.EthTx, error)
Copy link
Member

Choose a reason for hiding this comment

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

We should return an ErrUnsupported from EthModule for these methods instead of just a blank response.

@raulk raulk merged commit 34d7135 into master Mar 12, 2023
@raulk raulk deleted the asr/fix-eth-api-gateway branch March 12, 2023 16:31
raulk added a commit that referenced this pull request Mar 13, 2023
fix: eth API: correct gateway restrictions, drop unimplemented methods
raulk added a commit that referenced this pull request Mar 13, 2023
fix: eth API: correct gateway restrictions, drop unimplemented methods
@raulk raulk modified the milestones: Eth RPC perf + fixes, v1.20.4 Mar 15, 2023
@jennijuju jennijuju modified the milestones: v1.20.4, v1.21.0 Mar 16, 2023
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.

4 participants