From 38ab4c126bf59f83afdd76e702a921715fb5d7dd Mon Sep 17 00:00:00 2001 From: curryxbo Date: Mon, 22 Apr 2024 12:14:47 +0800 Subject: [PATCH 1/2] fix ChallengeState --- node/validator/validator.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/node/validator/validator.go b/node/validator/validator.go index 2b16a3cb4..034513a59 100644 --- a/node/validator/validator.go +++ b/node/validator/validator.go @@ -5,6 +5,7 @@ import ( "crypto/ecdsa" "errors" "fmt" + "github.com/scroll-tech/go-ethereum/crypto" "math/big" "time" @@ -67,7 +68,14 @@ func (v *Validator) ChallengeState(batchIndex uint64) error { } opts.GasPrice = gasPrice opts.NoSend = true - tx, err := v.contract.ChallengeState(opts, batchIndex) + publicKey := v.privateKey.Public() + publicKeyECDSA, ok := publicKey.(*ecdsa.PublicKey) + if !ok { + log.Error("cannot assert type: publicKey is not of type *ecdsa.PublicKey") + } + + receiver := crypto.PubkeyToAddress(*publicKeyECDSA) + tx, err := v.contract.ChallengeState(opts, batchIndex, receiver) if err != nil { return err } From d689a494ca0fa0a432a99138c95f39b4139ceb81 Mon Sep 17 00:00:00 2001 From: curryxbo Date: Mon, 22 Apr 2024 12:15:45 +0800 Subject: [PATCH 2/2] fmt --- node/validator/validator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/validator/validator.go b/node/validator/validator.go index 034513a59..76d0fd924 100644 --- a/node/validator/validator.go +++ b/node/validator/validator.go @@ -5,7 +5,6 @@ import ( "crypto/ecdsa" "errors" "fmt" - "github.com/scroll-tech/go-ethereum/crypto" "math/big" "time" @@ -13,6 +12,7 @@ import ( "github.com/scroll-tech/go-ethereum" "github.com/scroll-tech/go-ethereum/accounts/abi/bind" ethtypes "github.com/scroll-tech/go-ethereum/core/types" + "github.com/scroll-tech/go-ethereum/crypto" "github.com/scroll-tech/go-ethereum/ethclient" "github.com/scroll-tech/go-ethereum/log" tmlog "github.com/tendermint/tendermint/libs/log"