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

Replay run mode #320

Merged
merged 4 commits into from
May 30, 2024
Merged

Replay run mode #320

merged 4 commits into from
May 30, 2024

Conversation

tsahee
Copy link
Collaborator

@tsahee tsahee commented May 23, 2024

creates a new runmode for replaying message, which should produce same result as messageCommit but not be expected to be latest block

@cla-bot cla-bot bot added the s CLA signed label May 23, 2024
@tsahee tsahee requested a review from PlasmaPower May 23, 2024 02:23
@@ -80,7 +80,7 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
}
// Iterate over and process the individual transactions
for i, tx := range block.Transactions() {
msg, err := TransactionToMessage(tx, signer, header.BaseFee)
msg, err := TransactionToMessage(tx, signer, header.BaseFee, MessageCommitMode)
Copy link
Contributor

Choose a reason for hiding this comment

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

In Arbitrum, I think this is used by state recreation, not commit mode

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed that.
But we need to remember that, for when we switch to a more POS-like block addition.

@@ -1155,7 +1155,7 @@ func runScheduledTxes(ctx context.Context, b core.NodeInterfaceBackendAPI, state
scheduled := result.ScheduledTxes
for runMode == core.MessageGasEstimationMode && len(scheduled) > 0 {
// This will panic if the scheduled tx is signed, but we only schedule unsigned ones
msg, err := core.TransactionToMessage(scheduled[0], types.NewArbitrumSigner(nil), header.BaseFee)
msg, err := core.TransactionToMessage(scheduled[0], types.NewArbitrumSigner(nil), header.BaseFee, core.MessageReplayMode)
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is replay mode, I think it should use runMode. In fact, we currently override it below, which could be replaced by this parameter.

Copy link
Contributor

@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

@tsahee tsahee merged commit 0deab11 into master May 30, 2024
3 of 4 checks passed
@tsahee tsahee deleted the replay_run_mode branch May 30, 2024 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s CLA signed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants