-
Notifications
You must be signed in to change notification settings - Fork 867
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
Corrected eth_getLogs default fromBlock value. #4513
Conversation
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.
for completeness can you add a test for the invalid case - what happens if I supply a non-parseable string
...t/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/BlockParameterTest.java
Outdated
Show resolved
Hide resolved
...t/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/BlockParameterTest.java
Outdated
Show resolved
Hide resolved
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 think we need to first define which is our goal, because I see 2 possibility here:
- Follow the specs, then we need to reject everything that is not an uint, and return an error to the caller
- Extend the functionality, accepting with block names "lastest", "earlier" etc... then we need to interpret them correctly
I think option 2 is preferable; maintaining API consistency by using the |
Ok then take a look at |
…ion in eth_getLogs RPC handler. Added tests. Signed-off-by: mark-terry <mark.terry@consensys.net>
aa6a0c4
to
8f6a803
Compare
...api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetLogs.java
Outdated
Show resolved
Hide resolved
Signed-off-by: mark-terry <mark.terry@consensys.net>
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.
ok the parameter interpretation, it will be nice to have an abstract class for FilterParameters
similar to what AbstractBlockParameterMethod
does for BlockParameter
to unify all methods that use the filter, but this is probably a refactor that can be done separately.
Have you tested this PR with a Consensus client? since eth_getLogs
is critial after the merge
...src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetLogsTest.java
Outdated
Show resolved
Hide resolved
Signed-off-by: mark-terry <mark.terry@consensys.net>
It's currently running with Teku on Sepolia without any obvious issues. 👍 |
Signed-off-by: mark-terry <36909937+mark-terry@users.noreply.github.com>
- Initiate connection to maintained peers soon after startup. [#4469](https://github.com/hyperledger/besu/pull/4469) | ||
- Update apache-commons-text to 1.10.0 to address CVE-2022-42889 [#4542](https://github.com/hyperledger/besu/pull/4542) |
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.
Please readd these 2 entries
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.
* Fixed default fromBlock value and improved parameter interpretation in eth_getLogs RPC handler. Improved test coverage. Signed-off-by: mark-terry <mark.terry@consensys.net> Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
* Fixed default fromBlock value and improved parameter interpretation in eth_getLogs RPC handler. Improved test coverage. Signed-off-by: mark-terry <mark.terry@consensys.net>
Signed-off-by: mark-terry mark.terry@consensys.net
PR description
Changes the default
fromBlock
value ineth_getLogs
fromearliest
tolatest
per the spec.Added tests to verify BlockParameter value interpretation.
Fixed Issue(s)
Fixes #4123
Documentation
doc-change-required
label to this PR ifupdates are required.
Changelog