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

eth/catalyst: use setcanonical instead of sethead in simulated fork #30465

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

holiman
Copy link
Contributor

@holiman holiman commented Sep 19, 2024

Fixes #30448

@MariusVanDerWijden
Copy link
Member

Hmm looks like a test for the simulated backend fails with this

@holiman
Copy link
Contributor Author

holiman commented Sep 20, 2024

In order to fix the failing test, I had to change the test semantics. In the old behaviour, it expected a dropped block to simply disappear, along with all txs. Now, however, we expect it to use the fork-events, where the tx pool actually picks up transactions that were dropped in a dropped head.
Thus, when we mine a new block on top, the tx will be included without us needing to do anything. So the test changes from one behaviour to another, and thus becomes a totally different test, really .

I'm not 100% sure if the changed test is ok, or if we should replace/fix it some other way. cc @karalabe ?

Copy link
Member

@rjl493456442 rjl493456442 left a comment

Choose a reason for hiding this comment

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

sgtm

@rjl493456442 rjl493456442 added this to the 1.14.10 milestone Sep 21, 2024
@@ -228,15 +228,13 @@ func TestForkResendTx(t *testing.T) {
if err := sim.Fork(parent.Hash()); err != nil {
t.Errorf("forking: %v", err)
}

// 5.
sim.Commit()
if err := client.SendTransaction(ctx, tx); err != nil {
Copy link
Contributor

@zhiqiangxu zhiqiangxu Sep 21, 2024

Choose a reason for hiding this comment

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

It seems the 2nd SendTransaction can be omitted if the tx is expected to be picked up automatically?

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.

Simulated backend Fork & blockchain SetHead don't emit removed logs event
4 participants