Skip to content

Commit 2eff6d3

Browse files
authored
[Gnosis] Don't call ExecuteSystemWithdrawals before Shanghai (#7160)
This is a patch to PR #6940. Withdrawal contract should not be called for pre-Shanghai block. The issue was found on gnosis_withdrawals_devnet_2 (PR #7150), causing ``` [WARN] [03-22|10:44:51.574] [7/15 Execution] Execution failed block=51035 hash=0xa8fb9e58eb734b7ce4e2e6260ad20e07a16039325f9924cc18ea61fa2eb5ee90 err="execution reverted" ```
1 parent ebfc234 commit 2eff6d3

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

consensus/aura/aura.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,6 +1434,9 @@ func (c *AuRa) ExecuteSystemWithdrawals(withdrawals []*types.Withdrawal, syscall
14341434
}
14351435

14361436
_, err = syscall(*c.cfg.WithdrawalContractAddress, packed)
1437+
if err != nil {
1438+
log.Warn("ExecuteSystemWithdrawals", "err", err)
1439+
}
14371440
return err
14381441
}
14391442

consensus/serenity/serenity.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,10 @@ func (s *Serenity) Finalize(config *chain.Config, header *types.Header, state *s
134134
if err := auraEngine.ApplyRewards(header, state, syscall); err != nil {
135135
return nil, nil, err
136136
}
137-
if err := auraEngine.ExecuteSystemWithdrawals(withdrawals, syscall); err != nil {
138-
return nil, nil, err
137+
if withdrawals != nil {
138+
if err := auraEngine.ExecuteSystemWithdrawals(withdrawals, syscall); err != nil {
139+
return nil, nil, err
140+
}
139141
}
140142
} else {
141143
for _, w := range withdrawals {

0 commit comments

Comments
 (0)