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

op-service: withdrawals typing fixes #7767

Merged
merged 3 commits into from
Oct 23, 2023
Merged

Conversation

protolambda
Copy link
Contributor

  • use geth withdrawals type
  • verify withdrawals in rpc-block verification
  • add test vectors and rpc-block tests

There is no need for a new eth.Withdrawal and eth.Withdrawals type, since the withdrawal is a small and lightweight struct already; matching what we have in the execution-payload.

In the EthClient and its RPC block decoding, we need the withdrawal attributes to be decoded and verified correctly, or completely ignored and non-exposed.
For shanghai support the withdrawals block data was added, but the parsing was broken, causing the node to get stuck on withdrawal data.

Tests

Added test-vectors for pre and post shanghai blocks, and turned the old header tests into the same test vector format.

Additional context

Things got broken in:

…k verification, add test vectors and rpc-block tests
@tynes
Copy link
Contributor

tynes commented Oct 20, 2023

Generally looks good to me, needs linting

golangci-lint run -E goimports,sqlclosecheck,bodyclose,asciicheck,misspell,errorlint --timeout 5m -e "errors.As" -e "errors.Is" ./...
e2eutils/geth/fakepos.go:4: File is not `goimports`-ed (goimports)
        "github.com/ethereum-optimism/optimism/op-service/testutils"
make: *** [Makefile:56: lint] Error 1

Exited with code exit status 2

@protolambda
Copy link
Contributor Author

fixed linting issue 👍

Copy link
Contributor

@trianglesphere trianglesphere left a comment

Choose a reason for hiding this comment

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

I really like the script to generate good test data

op-service/sources/testdata/gen.sh Show resolved Hide resolved
Copy link
Contributor

@ajsutton ajsutton left a comment

Choose a reason for hiding this comment

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

LGTM.

op-service/sources/testdata/gen.sh Outdated Show resolved Hide resolved
Co-authored-by: Adrian Sutton <adrian@oplabs.co>
@semgrep-app
Copy link
Contributor

semgrep-app bot commented Oct 23, 2023

Semgrep found 1 todos_require_linear finding:

  • .circleci/config.yml: L1232

Please create a Linear ticket for this TODO.

Ignore this finding from todos_require_linear.

@protolambda protolambda added this pull request to the merge queue Oct 23, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 23, 2023
@sebastianst sebastianst added this pull request to the merge queue Oct 23, 2023
Merged via the queue into develop with commit 0faa774 Oct 23, 2023
64 checks passed
@sebastianst sebastianst deleted the withdrawals-type-fix branch October 23, 2023 20:21
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.

5 participants