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

Creates validator wallet through Staker's DataPoster #2573

Merged
merged 13 commits into from
Sep 2, 2024

Conversation

diegoximenes
Copy link
Contributor

@diegoximenes diegoximenes commented Aug 12, 2024

Resolves NIT-2665

Creates validator wallet through Staker's DataPoster.

DataPoster infers the expected nonce to be used in a transaction by first looking into a QueueStorage object, that is mainly updated when transactions are submitted through DataPoster.PostTransaction.
If this first step fails, such as when the QueueStorage object is empty, then it relies on recent data from L1 to make this inference.
Information retrieved from L1 can be outdated, so warnings such as sequencer-1 | WARN [07-08|18:52:20.052] error acting as staker err="storage race error: data poster expected next transaction to have nonce 0 but was requested to post transaction with nonce 1" can be logged.

The Staker DataPoster's key is used to send a transaction to create a validator wallet.
But today this transaction is not sent through DataPoster.PostTransaction, so the QueueStorage object owned by Staker's DataPoster is not updated, and then the inference of the expected nonce is compromised.

This PR makes the validator wallet creation to occur through the Staker's DataPoster.

@cla-bot cla-bot bot added the s Automatically added by the CLA bot if the creator of a PR is registered as having signed the CLA. label Aug 12, 2024
@diegoximenes diegoximenes changed the title Staker data poster wallet Creates validator wallet through Staker's DataPoster Aug 12, 2024
@diegoximenes diegoximenes marked this pull request as ready for review August 12, 2024 20:03
cmd/nitro/nitro.go Outdated Show resolved Hide resolved
staker/validatorwallet/contract.go Outdated Show resolved Hide resolved
staker/validatorwallet/contract.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@PlasmaPower PlasmaPower left a comment

Choose a reason for hiding this comment

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

One last comment but largely LGTM

arbnode/node.go Outdated Show resolved Hide resolved
cmd/nitro/nitro.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@PlasmaPower PlasmaPower left a comment

Choose a reason for hiding this comment

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

LGTM

@PlasmaPower PlasmaPower merged commit 7722fef into master Sep 2, 2024
15 checks passed
@PlasmaPower PlasmaPower deleted the staker_data_poster_wallet branch September 2, 2024 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design-approved s Automatically added by the CLA bot if the creator of a PR is registered as having signed the CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants