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(txSkip): address collisions #1510

Conversation

letypequividelespoubelles
Copy link
Collaborator

No description provided.

Signed-off-by: F Bojarski <ceciestunepoubelle@protonmail.ch>
Signed-off-by: F Bojarski <ceciestunepoubelle@protonmail.ch>
Signed-off-by: F Bojarski <ceciestunepoubelle@protonmail.ch>
@letypequividelespoubelles letypequividelespoubelles marked this pull request as ready for review November 19, 2024 14:48
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

no real change in this file, just added final, moved some function to TransactionProcessingMetadataand factorize the last transaction fragment.

Signed-off-by: F Bojarski <ceciestunepoubelle@protonmail.ch>
}

@Test
void senderIsCoinbaseIsReceiver() {
Copy link
Collaborator

@OlivierBBB OlivierBBB Nov 21, 2024

Choose a reason for hiding this comment

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

One test to rule them all 👑

“It is a strange fate that we should suffer so much fear and doubt over so small a thing … such a little thing.”

.zkTracerValidator(zkTracer -> {})
.build()
.run();
}
Copy link
Collaborator

@OlivierBBB OlivierBBB Nov 21, 2024

Choose a reason for hiding this comment

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

Does this test succeed ? We had a regression in Besu with @ahamlat / @Gabriel-Trintinalia / @lu-pinto's fix being undone in a recent commit, which may make this test fail now.

DomSubStampsSubFragment.standardDomSubStamps(hub.stamp(), 2));

this.addFragments(firstAccountFragment, secondAccountFragment, thirdAccountFragment);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

We will really need account consistency constraints to test this properly 😅.

AccountSnapshot.canonical(hub, world, recipientAccountSnapshotBefore.address());

final AccountSnapshot coinbaseAccountSnapshotAfter =
AccountSnapshot.canonical(hub, world, coinbaseAccountSnapshotBefore.address());
Copy link
Collaborator

@OlivierBBB OlivierBBB Nov 21, 2024

Choose a reason for hiding this comment

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

I'm noticing that in the old version we were copying over the warmths. I don't have the spec in mind, and I doubt that it fundamentally matters. But the question remains: is the fact that there is no mention of warmths an oversight ?

The spec says that one should keep warmths for TX_SKIP as they are. I wonder what that would mean e.g. if

  • sender is a precompile (can we even test this ? Or would we need to produce a signature for the (unknown) private key of a precompile) ?
  • coinbase is a precompile (those are warm by default)

N.B. Recipients may not be precompiles.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think IRL it's possible to have sender / coinbase that is a precompile ...

In the spec, we only constrain the warmth to remains constant, thus it's better to be hot -> hot as it could be warmed (being on the accessList , or so). So when taking teh snapshot, better to turn on the warmth all the time.

.accountFragment()
.make(
senderSnapshotBeforeFinalization,
coinbaseSnapshotAfterFinalization,
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should indeed work

Copy link
Collaborator

@OlivierBBB OlivierBBB left a comment

Choose a reason for hiding this comment

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

We need some more testing. In particular the case(s?) I laid out, where the coinbase is a precompile. We may find issues wrt its warmth.

@OlivierBBB
Copy link
Collaborator

OlivierBBB commented Nov 21, 2024

Also if we don't have them yet we should add tests for TX_SKIP with trivial deployments. We can play the same games of

  • sender is coinbase
  • (deployment address) is coinbase
  • coinbase is a precompile

@letypequividelespoubelles letypequividelespoubelles merged commit 23a3d36 into arith-dev Nov 21, 2024
5 checks passed
@letypequividelespoubelles letypequividelespoubelles deleted the 1018-txskippedsection-doesnt-take-address-collision-shenanigans-into-account branch November 21, 2024 13:48
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.

TxSkippedSection doesn't take address collision shenanigans into account
3 participants