fix: make sure building of pending blocks don't have any lasting sideaffects (#779)

This commit is contained in:
Ömer Faruk Irmak 2024-05-28 12:54:36 +03:00 committed by GitHub
parent b9919a572a
commit 89ff451c77
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 9 deletions

View file

@ -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
@ -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 {
@ -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

View file

@ -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
)