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(op): fix payload id calculation #11730

Merged
merged 3 commits into from
Oct 28, 2024
Merged

fix(op): fix payload id calculation #11730

merged 3 commits into from
Oct 28, 2024

Conversation

Rjected
Copy link
Member

@Rjected Rjected commented Oct 14, 2024

Attempt at fixing #11729

Also updates to add the newly added eip1559 params

Right now the test from the issue fails, hopefully something simple

@Rjected Rjected added C-bug An unexpected or incorrect behavior A-block-building Related to block building A-op-reth Related to Optimism and op-reth labels Oct 14, 2024
@Rjected
Copy link
Member Author

Rjected commented Oct 14, 2024

EDIT: the test now fails because we need to put the version as the first byte, which is sort of annoying:

  left: PayloadId(0x03d2dae446d2a86a)
 right: PayloadId(0x34d2dae446d2a86a)

from op-geth:

	out[0] = byte(args.Version)
	return out

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.

makes sense

Comment on lines 292 to 294
let no_tx_pool = attributes.no_tx_pool.unwrap_or_default();
hasher.update([no_tx_pool as u8]);
let txs_len = attributes.transactions.as_ref().map(|txs| txs.len()).unwrap_or_default();
Copy link
Collaborator

Choose a reason for hiding this comment

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

we now have multiple calls to unwrap_or_default.

can we do this just once

@avalonche
Copy link

any updates to this? seems like geth adds the payload version to the payload_id that is causing the discrepancy

ethereum/go-ethereum#28246

@mattsse mattsse marked this pull request as ready for review October 28, 2024 15:50
@mattsse
Copy link
Collaborator

mattsse commented Oct 28, 2024

unblocked now
@Rjected we can also include test cases from deacb4b that we haven't merged

@Rjected Rjected added this pull request to the merge queue Oct 28, 2024
Merged via the queue into main with commit ddc9bda Oct 28, 2024
40 checks passed
@Rjected Rjected deleted the dan/fix-op-payload-id branch October 28, 2024 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-block-building Related to block building A-op-reth Related to Optimism and op-reth C-bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants