Skip to content

Commit

Permalink
Check bcast.From correctly (#12941)
Browse files Browse the repository at this point in the history
* ensure bcast.From == mgr.From()

* address comment

* fix for create2
  • Loading branch information
zhiqiangxu authored Nov 18, 2024
1 parent 914157f commit 7550853
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions op-deployer/pkg/deployer/broadcaster/keyed.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ func NewKeyedBroadcaster(cfg KeyedBroadcasterOpts) (*KeyedBroadcaster, error) {
}

func (t *KeyedBroadcaster) Hook(bcast script.Broadcast) {
if bcast.Type != script.BroadcastCreate2 && bcast.From != t.mgr.From() {
panic(fmt.Sprintf("invalid from for broadcast:%v, expected:%v", bcast.From, t.mgr.From()))
}
t.mtx.Lock()
t.bcasts = append(t.bcasts, bcast)
t.mtx.Unlock()
Expand Down

0 comments on commit 7550853

Please sign in to comment.