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: make sure building of pending blocks don't have any lasting sideaffects #779

Merged
merged 2 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions miner/scroll_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,14 @@ func (w *worker) startNewPipeline(timestamp int64) {
}

func (w *worker) handlePipelineResult(res *pipeline.Result) error {
if !w.isRunning() {
if res != nil && res.FinalBlock != nil {
w.updateSnapshot(res.FinalBlock)
}
w.currentPipeline = nil
return nil
}

if res != nil && res.OverflowingTx != nil {
if res.FinalBlock == nil {
// first txn overflowed the circuit, skip
Expand Down Expand Up @@ -602,14 +610,6 @@ func (w *worker) handlePipelineResult(res *pipeline.Result) error {
}
}

if !w.isRunning() {
if res != nil && res.FinalBlock != nil {
w.updateSnapshot(res.FinalBlock)
}
w.currentPipeline = nil
return nil
}

var commitError error
if res != nil && res.FinalBlock != nil {
if commitError = w.commit(res); commitError == nil {
Expand Down Expand Up @@ -747,6 +747,10 @@ func (w *worker) postSideBlock(event core.ChainSideEvent) {
}

func (w *worker) onTxFailingInPipeline(txIndex int, tx *types.Transaction, err error) bool {
if !w.isRunning() {
return false
}

writeTrace := func() {
var trace *types.BlockTrace
var errWithTrace *pipeline.ErrorWithTrace
Expand Down
2 changes: 1 addition & 1 deletion params/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
const (
VersionMajor = 5 // Major version component of the current release
VersionMinor = 3 // Minor version component of the current release
VersionPatch = 24 // Patch version component of the current release
VersionPatch = 25 // Patch version component of the current release
VersionMeta = "mainnet" // Version metadata to append to the version string
)

Expand Down