Skip to content

Commit

Permalink
[Gnosis] Don't call ExecuteSystemWithdrawals before Shanghai (ledgerw…
Browse files Browse the repository at this point in the history
…atch#7160)

This is a patch to PR ledgerwatch#6940. Withdrawal contract should not be called
for pre-Shanghai block. The issue was found on
gnosis_withdrawals_devnet_2 (PR ledgerwatch#7150), causing
```
[WARN] [03-22|10:44:51.574] [7/15 Execution] Execution failed        block=51035 hash=0xa8fb9e58eb734b7ce4e2e6260ad20e07a16039325f9924cc18ea61fa2eb5ee90 err="execution reverted"
```
  • Loading branch information
yperbasis authored and calmbeing committed Apr 24, 2023
1 parent 0b713ff commit 4e3b63f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions consensus/aura/aura.go
Original file line number Diff line number Diff line change
Expand Up @@ -1434,6 +1434,9 @@ func (c *AuRa) ExecuteSystemWithdrawals(withdrawals []*types.Withdrawal, syscall
}

_, err = syscall(*c.cfg.WithdrawalContractAddress, packed)
if err != nil {
log.Warn("ExecuteSystemWithdrawals", "err", err)
}
return err
}

Expand Down
6 changes: 4 additions & 2 deletions consensus/serenity/serenity.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,10 @@ func (s *Serenity) Finalize(config *chain.Config, header *types.Header, state *s
if err := auraEngine.ApplyRewards(header, state, syscall); err != nil {
return nil, nil, err
}
if err := auraEngine.ExecuteSystemWithdrawals(withdrawals, syscall); err != nil {
return nil, nil, err
if withdrawals != nil {
if err := auraEngine.ExecuteSystemWithdrawals(withdrawals, syscall); err != nil {
return nil, nil, err
}
}
} else {
for _, w := range withdrawals {
Expand Down

0 comments on commit 4e3b63f

Please sign in to comment.