mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-24 00:39:26 +00:00
core: preface invalid bal errors so they are caught by the exception mapper
This commit is contained in:
parent
985cdac8a7
commit
6a79e3693b
1 changed files with 5 additions and 4 deletions
|
|
@ -106,6 +106,7 @@ func (p *ParallelStateProcessor) prepareExecResult(block *types.Block, tExecStar
|
||||||
for _, result := range results {
|
for _, result := range results {
|
||||||
sumRegular += result.txRegular
|
sumRegular += result.txRegular
|
||||||
sumState += result.txState
|
sumState += result.txState
|
||||||
|
|
||||||
cumulativeReceipt += result.execGas
|
cumulativeReceipt += result.execGas
|
||||||
result.receipt.CumulativeGasUsed = cumulativeReceipt
|
result.receipt.CumulativeGasUsed = cumulativeReceipt
|
||||||
allLogs = append(allLogs, result.receipt.Logs...)
|
allLogs = append(allLogs, result.receipt.Logs...)
|
||||||
|
|
@ -156,14 +157,14 @@ func (p *ParallelStateProcessor) prepareExecResult(block *types.Block, tExecStar
|
||||||
accessList := bal.NewAccessListReader(*block.AccessList())
|
accessList := bal.NewAccessListReader(*block.AccessList())
|
||||||
if !postMut.Eq(*accessList.MutationsAt(lastBALIdx)) {
|
if !postMut.Eq(*accessList.MutationsAt(lastBALIdx)) {
|
||||||
return &ProcessResultWithMetrics{
|
return &ProcessResultWithMetrics{
|
||||||
ProcessResult: &ProcessResult{Error: fmt.Errorf("mismatch between local/remote access list mutations for final idx")},
|
ProcessResult: &ProcessResult{Error: fmt.Errorf("invalid block access list: mismatch between local/remote access list mutations for final idx")},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
accesses.Merge(postTxAccesses)
|
accesses.Merge(postTxAccesses)
|
||||||
if !validateStateAccesses(lastBALIdx, accessList, accesses) {
|
if !validateStateAccesses(lastBALIdx, accessList, accesses) {
|
||||||
return &ProcessResultWithMetrics{
|
return &ProcessResultWithMetrics{
|
||||||
ProcessResult: &ProcessResult{Error: fmt.Errorf("mismatch between local/remote access list for state accesses")},
|
ProcessResult: &ProcessResult{Error: fmt.Errorf("invalid block access list: mismatch between local/remote access list for state accesses")},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -300,7 +301,7 @@ func (p *ParallelStateProcessor) execTx(block *types.Block, tx *types.Transactio
|
||||||
|
|
||||||
accessList := bal.NewAccessListReader(*block.AccessList())
|
accessList := bal.NewAccessListReader(*block.AccessList())
|
||||||
if !accessList.MutationsAt(balIdx).Eq(mut) {
|
if !accessList.MutationsAt(balIdx).Eq(mut) {
|
||||||
err := fmt.Errorf("mismatch between local/remote computed state mutations at bal idx %d. got:\n%s\nexpected:\n%s\n", balIdx, mut.String(), accessList.MutationsAt(balIdx).String())
|
err := fmt.Errorf("invalid block access list: mismatch between local/remote computed state mutations at bal idx %d. got:\n%s\nexpected:\n%s\n", balIdx, mut.String(), accessList.MutationsAt(balIdx).String())
|
||||||
return &txExecResult{err: err}
|
return &txExecResult{err: err}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -338,7 +339,7 @@ func (p *ParallelStateProcessor) processBlockPreTx(block *types.Block, statedb *
|
||||||
mutations.Merge(pbhMutations)
|
mutations.Merge(pbhMutations)
|
||||||
reads := readerWithTracker.(state.StateReaderTracker).GetStateAccessList()
|
reads := readerWithTracker.(state.StateReaderTracker).GetStateAccessList()
|
||||||
if !accessList.MutationsAt(0).Eq(mutations) {
|
if !accessList.MutationsAt(0).Eq(mutations) {
|
||||||
return nil, fmt.Errorf("mismatch between local/remote access list mutations at idx 0")
|
return nil, fmt.Errorf("invalid block access list: mismatch between local/remote access list mutations at idx 0")
|
||||||
}
|
}
|
||||||
return reads, nil
|
return reads, nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue