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: deny unknown payload fields #4667

Merged
merged 3 commits into from
Sep 19, 2023

Conversation

Rjected
Copy link
Member

@Rjected Rjected commented Sep 19, 2023

A hive test would send an excessBlobGas field to our engine_newPayloadV2 endpoint, and the test expected us to return the Invalid params code and error.

This adds deny_unknown_fields to payload types, and adds tests that make sure unknown fields are rejected.

This causes the pyspec cancun/eip4844_blobs/excess_blob_gas_fork_transition/invalid_pre_fork_block_with_blob_fields/000-fork=ShanghaiToCancunAtTime15k-excess_blob_gas_present=True-blob_gas_used_present=False-invalid_pre_fork_blob_fields test to succeed.

@Rjected Rjected added C-bug An unexpected or incorrect behavior A-rpc Related to the RPC implementation C-test A change that impacts how or what we test E-cancun Related to the Cancun network upgrade labels Sep 19, 2023
@codecov
Copy link

codecov bot commented Sep 19, 2023

Codecov Report

Merging #4667 (217b21e) into main (a80b720) will increase coverage by 0.03%.
Report is 3 commits behind head on main.
The diff coverage is 100.00%.

Impacted file tree graph

Files Changed Coverage Δ
crates/rpc/rpc-types/src/eth/engine/payload.rs 80.74% <100.00%> (+15.69%) ⬆️

... and 16 files with indirect coverage changes

Flag Coverage Δ
integration-tests 16.77% <0.00%> (-0.06%) ⬇️
unit-tests 63.42% <100.00%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
reth binary 32.17% <ø> (ø)
blockchain tree 83.75% <ø> (+0.16%) ⬆️
pipeline 88.54% <ø> (ø)
storage (db) 73.47% <ø> (ø)
trie 94.73% <ø> (ø)
txpool 49.91% <ø> (+0.46%) ⬆️
networking 77.23% <ø> (-0.02%) ⬇️
rpc 57.83% <100.00%> (+0.27%) ⬆️
consensus 62.67% <ø> (+0.02%) ⬆️
revm 28.04% <ø> (ø)
payload builder 8.45% <ø> (-0.12%) ⬇️
primitives 86.51% <ø> (-0.01%) ⬇️

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

lgtm

@Rjected Rjected added this pull request to the merge queue Sep 19, 2023
Merged via the queue into main with commit 449a9c0 Sep 19, 2023
22 checks passed
@Rjected Rjected deleted the dan/ensure-pre-cancun-block-has-no-blob-fields branch September 19, 2023 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rpc Related to the RPC implementation C-bug An unexpected or incorrect behavior C-test A change that impacts how or what we test E-cancun Related to the Cancun network upgrade
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants