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

Add getPayloadBodiesByRangeV1 and getPayloadBodiesByHash engine methods #4980

Merged
merged 61 commits into from
Feb 9, 2023
Merged
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
b1f2abd
Add engine get payload body methods and test
wcgcyx Jan 12, 2023
4c3568e
Add header
wcgcyx Jan 12, 2023
bb5c6ed
Update result struct & add test
wcgcyx Jan 12, 2023
70ee2a5
Change constant to use upper case
wcgcyx Jan 16, 2023
0b120cb
Add PayloadBody class and withdrawals to response of methods
gfukushima Jan 23, 2023
49a3df2
Add unit tests
gfukushima Jan 23, 2023
32bf2f2
Add changelog
gfukushima Jan 23, 2023
1b4a2da
spotless
gfukushima Jan 23, 2023
7edc4d0
Add check to prevent returning trailing null results past the head
gfukushima Jan 24, 2023
1debe06
Add test to check trailing null post head scenario
gfukushima Jan 24, 2023
fdf1c4d
Split tests into pre and post shanghai
gfukushima Jan 24, 2023
fb86166
spotless
gfukushima Jan 24, 2023
9bdacea
Rename methods
gfukushima Jan 24, 2023
bfc98a0
Merge branch 'main' into add-getblock-engine-methods
gfukushima Jan 24, 2023
e43b88e
Use getName() to log method name
gfukushima Jan 24, 2023
423b66a
spotless
gfukushima Jan 24, 2023
fa72ac5
Merge branch 'main' into add-getblock-engine-methods
gfukushima Jan 24, 2023
c8aa200
Merge branch 'main' into add-getblock-engine-methods
gfukushima Jan 25, 2023
367d601
Rename variable
gfukushima Jan 25, 2023
61bce3d
Call constructor directly
gfukushima Jan 25, 2023
bccde29
Merge remote-tracking branch 'origin/add-getblock-engine-methods' int…
gfukushima Jan 25, 2023
650e70c
Merge branch 'main' into add-getblock-engine-methods
gfukushima Jan 25, 2023
663e11e
Fix ByHash json parsing
siladu Jan 25, 2023
2139828
Merge remote-tracking branch 'upstream/main' into add-getblock-engine…
siladu Jan 26, 2023
558d325
Fix json parsing again
siladu Jan 26, 2023
cfb88cc
Add check to prevent unnecessary queries
gfukushima Jan 26, 2023
f5b1d3c
Refactor method
gfukushima Jan 26, 2023
d726acb
Add new error code for EngineGetPayloadBodies methods
gfukushima Jan 27, 2023
840a59d
Add return error for request above the API limit
gfukushima Jan 27, 2023
e9d138b
Add constructor for empty response
gfukushima Jan 27, 2023
4cf2f51
add check for number of blocks requested and for requests of post head
gfukushima Jan 27, 2023
b3b7c58
Add test to check error code when request exceeds API limits
gfukushima Jan 27, 2023
334c700
add constant for max blocks allowed per request
gfukushima Jan 27, 2023
a5a2610
spotless
gfukushima Jan 27, 2023
35719c9
Merge branch 'main' into add-getblock-engine-methods
gfukushima Jan 27, 2023
e8e5a02
Fix some nits
gfukushima Jan 30, 2023
db5447f
Add invalid params check
gfukushima Jan 30, 2023
77da267
Add tests for invalid params check
gfukushima Jan 30, 2023
dbb6231
Fix test and spotless
gfukushima Jan 30, 2023
b7ae081
Merge branch 'main' into add-getblock-engine-methods
gfukushima Jan 30, 2023
2385ad7
Merge remote-tracking branch 'origin/add-getblock-engine-methods' int…
gfukushima Jan 30, 2023
08b90a9
Revert "Fix json parsing again"
gfukushima Feb 2, 2023
00a8b1b
Revert "Fix ByHash json parsing Signed-off-by: Simon Dudley <simon.du…
gfukushima Feb 2, 2023
48a8732
Use UnsignedLongParameter to cast params of the request
gfukushima Feb 2, 2023
f838d57
Add optional withdrawals to the NewPayload log (#5021)
siladu Jan 30, 2023
b3b62fd
kubernetes and errorprone - update versions (#5013)
macfarla Feb 1, 2023
9018c4b
Rename JsonRpcService to EngineJsonRpcService (#5036)
daniellehrner Feb 1, 2023
7b10e9f
Params should be single item of array type, not outer array of string…
siladu Feb 1, 2023
7554285
Add EIP-2537 (BLS12-381 curve precompiles) to Cancun (#5017)
shemnon Feb 1, 2023
6b8927e
Merge branch 'main' into add-getblock-engine-methods
gfukushima Feb 2, 2023
3e903dc
Use UnsignedLongParameter to cast params of the request
gfukushima Feb 2, 2023
f1f49bf
Add optional withdrawals to the NewPayload log (#5021)
siladu Jan 30, 2023
d4e5120
kubernetes and errorprone - update versions (#5013)
macfarla Feb 1, 2023
5700e9b
Rename JsonRpcService to EngineJsonRpcService (#5036)
daniellehrner Feb 1, 2023
24a174d
Params should be single item of array type, not outer array of string…
siladu Feb 1, 2023
9dd4185
Add EIP-2537 (BLS12-381 curve precompiles) to Cancun (#5017)
shemnon Feb 1, 2023
afed502
Convert start and count from hex to match JSON-RPC Spec standard
gfukushima Feb 3, 2023
e7b5f7c
Merge branch 'main' into add-getblock-engine-methods
gfukushima Feb 3, 2023
ab05f35
Resolve merge conflicts
gfukushima Feb 3, 2023
740c895
Merge branch 'main' into add-getblock-engine-methods
siladu Feb 7, 2023
3a644ad
Merge branch 'main' into add-getblock-engine-methods
gfukushima Feb 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,15 @@ public JsonRpcResponse syncResponse(final JsonRpcRequestContext request) {
() -> count);

final Blockchain blockchain = protocolContext.getBlockchain();

final long latestKnownBlockNumber = blockchain.getChainHeadBlockNumber();
final long upperBound = startBlockNumber + count;
final long finalBlockNumber = latestKnownBlockNumber < upperBound ? latestKnownBlockNumber + 1 : upperBound;
siladu marked this conversation as resolved.
Show resolved Hide resolved

return new JsonRpcSuccessResponse(
request.getRequest().getId(),
blockResultFactory.payloadBodiesCompleteV1(
LongStream.range(startBlockNumber, startBlockNumber + count)
LongStream.range(startBlockNumber, finalBlockNumber)
.mapToObj(
blockNumber ->
blockchain
Expand Down