Skip to content

Commit

Permalink
Merge pull request #1218 from OffchainLabs/log-tx-sender
Browse files Browse the repository at this point in the history
Log tx sender in "validator address isn't whitelisted" log line
  • Loading branch information
PlasmaPower authored Oct 6, 2022
2 parents 75e48e6 + 836ab07 commit d972cae
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions validator/eoa_validator_wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ func (w *EoaValidatorWallet) AddressOrZero() common.Address {
return w.auth.From
}

func (w *EoaValidatorWallet) TxSenderAddress() *common.Address {
return &w.auth.From
}

func (w *EoaValidatorWallet) L1Client() arbutil.L1Interface {
return w.client
}
Expand Down
2 changes: 1 addition & 1 deletion validator/staker.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ func (s *Staker) Act(ctx context.Context) (*types.Transaction, error) {
return nil, err
}
if !whitelisted {
log.Warn("validator address isn't whitelisted", "address", s.wallet.Address())
log.Warn("validator address isn't whitelisted", "address", s.wallet.Address(), "txSender", s.wallet.TxSenderAddress())
}
}
if !s.shouldAct(ctx) {
Expand Down
8 changes: 8 additions & 0 deletions validator/validator_wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ type ValidatorWalletInterface interface {
Initialize(context.Context) error
Address() *common.Address
AddressOrZero() common.Address
TxSenderAddress() *common.Address
RollupAddress() common.Address
ChallengeManagerAddress() common.Address
L1Client() arbutil.L1Interface
Expand Down Expand Up @@ -137,6 +138,13 @@ func (v *ContractValidatorWallet) AddressOrZero() common.Address {
return *v.address
}

func (v *ContractValidatorWallet) TxSenderAddress() *common.Address {
if v.auth == nil {
return nil
}
return &v.auth.From
}

func (v *ContractValidatorWallet) From() common.Address {
if v.auth == nil {
return common.Address{}
Expand Down

0 comments on commit d972cae

Please sign in to comment.