diff --git a/Makefile b/Makefile index a708ee8e7..c2480796b 100644 --- a/Makefile +++ b/Makefile @@ -19,11 +19,11 @@ update: ## update dependencies cd $(PWD)/coordinator/ && go get -u github.com/scroll-tech/go-ethereum@staging && go mod tidy cd $(PWD)/database/ && go get -u github.com/scroll-tech/go-ethereum@staging && go mod tidy cd $(PWD)/roller/ && go get -u github.com/scroll-tech/go-ethereum@staging && go mod tidy - goimports -local $(PWD)/bridge/ -w . - goimports -local $(PWD)/common/ -w . - goimports -local $(PWD)/coordinator/ -w . - goimports -local $(PWD)/database/ -w . - goimports -local $(PWD)/roller/ -w . + /Users/chuhanjinwork/go/bin/goimports -local $(PWD)/bridge/ -w . + /Users/chuhanjinwork/go/bin/goimports -local $(PWD)/common/ -w . + /Users/chuhanjinwork/go/bin/goimports -local $(PWD)/coordinator/ -w . + /Users/chuhanjinwork/go/bin/goimports -local $(PWD)/database/ -w . + /Users/chuhanjinwork/go/bin/goimports -local $(PWD)/roller/ -w . dev_docker: ## build docker images for development/testing usages docker build -t scroll_l1geth ./common/docker/l1geth/ diff --git a/bridge/l1/relayer.go b/bridge/l1/relayer.go index 8a0f94908..736fc09b4 100644 --- a/bridge/l1/relayer.go +++ b/bridge/l1/relayer.go @@ -66,6 +66,11 @@ func NewLayer1Relayer(ctx context.Context, l1ConfirmNum int64, db orm.L1MessageO }, nil } +// GetConfirmCh returns the confirmation channel +func (r *Layer1Relayer) GetConfirmCh() <-chan *sender.Confirmation { + return r.confirmationCh +} + // ProcessSavedEvents relays saved un-processed cross-domain transactions to desired blockchain func (r *Layer1Relayer) ProcessSavedEvents() { // msgs are sorted by nonce in increasing order diff --git a/bridge/l2/relayer.go b/bridge/l2/relayer.go index f0da0b69e..92ae3eba6 100644 --- a/bridge/l2/relayer.go +++ b/bridge/l2/relayer.go @@ -93,6 +93,11 @@ func NewLayer2Relayer(ctx context.Context, db database.OrmFactory, cfg *config.R }, nil } +// GetMsgConfirmCh returns the messageCh in layer2Relayer +func (r *Layer2Relayer) GetMsgConfirmCh() <-chan *sender.Confirmation { + return r.messageCh +} + const processMsgLimit = 100 // ProcessSavedEvents relays saved un-processed cross-domain transactions to desired blockchain @@ -417,9 +422,9 @@ func (r *Layer2Relayer) Start() { go r.ProcessCommittedBatches(&wg) wg.Wait() case confirmation := <-r.messageCh: - r.handleConfirmation(confirmation) + r.HandleConfirmation(confirmation) case confirmation := <-r.rollupCh: - r.handleConfirmation(confirmation) + r.HandleConfirmation(confirmation) case <-r.stopCh: return } @@ -432,7 +437,8 @@ func (r *Layer2Relayer) Stop() { close(r.stopCh) } -func (r *Layer2Relayer) handleConfirmation(confirmation *sender.Confirmation) { +// HandleConfirmation process received confirmation result +func (r *Layer2Relayer) HandleConfirmation(confirmation *sender.Confirmation) { if !confirmation.IsSuccessful { log.Warn("transaction confirmed but failed in layer1", "confirmation", confirmation) return diff --git a/bridge/multibin/event-watcher/app/app.go b/bridge/multibin/event-watcher/app/app.go index d81922286..22f8d1c51 100644 --- a/bridge/multibin/event-watcher/app/app.go +++ b/bridge/multibin/event-watcher/app/app.go @@ -15,8 +15,7 @@ import ( "scroll-tech/common/version" "scroll-tech/bridge/config" - "scroll-tech/bridge/l1" - "scroll-tech/bridge/l2" + eventwatcher "scroll-tech/bridge/multibin/event-watcher" ) var ( @@ -63,11 +62,11 @@ func action(ctx *cli.Context) error { log.Crit("failed to connect l1 geth", "config file", cfgFile, "error", err) } var ( - l1watcher *l1.Watcher - l2watcher *l2.WatcherClient + l1watcher *eventwatcher.L1EventWatcher + l2watcher *eventwatcher.L2EventWatcher ) - l1watcher = l1.NewWatcher(ctx.Context, l1client, cfg.L1Config.StartHeight, cfg.L1Config.Confirmations, cfg.L1Config.L1MessengerAddress, cfg.L1Config.RollupContractAddress, ormFactory) - l2watcher, err = l2.NewL2WatcherClient(ctx.Context, l2client, cfg.L2Config.Confirmations, cfg.L2Config.BatchProposerConfig, cfg.L2Config.L2MessengerAddress, ormFactory) + l1watcher = eventwatcher.NewL1EventWatcher(ctx.Context, l1client, cfg.L1Config, ormFactory) + l2watcher, err = eventwatcher.NewL2EventWatcher(ctx.Context, l2client, cfg.L2Config, ormFactory) if err != nil { return err } diff --git a/bridge/multibin/event-watcher/cmd/main.go b/bridge/multibin/event-watcher/cmd/main.go new file mode 100644 index 000000000..e0524c441 --- /dev/null +++ b/bridge/multibin/event-watcher/cmd/main.go @@ -0,0 +1,7 @@ +package cmd + +import "scroll-tech/bridge/multibin/event-watcher/app" + +func main() { + app.Run() +} diff --git a/bridge/multibin/event-watcher/event_watcher.go b/bridge/multibin/event-watcher/event_watcher.go new file mode 100644 index 000000000..b4c56f0b8 --- /dev/null +++ b/bridge/multibin/event-watcher/event_watcher.go @@ -0,0 +1,124 @@ +package eventwatcher + +import ( + "context" + "time" + + "github.com/scroll-tech/go-ethereum/ethclient" + "github.com/scroll-tech/go-ethereum/log" + + "scroll-tech/bridge/config" + "scroll-tech/bridge/l1" + "scroll-tech/bridge/l2" + "scroll-tech/database" +) + +// L1EventWatcher is sturct to wrap l1.watcher +type L1EventWatcher struct { + ctx context.Context + watcher *l1.Watcher + client *ethclient.Client + stop chan struct{} +} + +// L2EventWatcher is struct to wrap l2.watcher +type L2EventWatcher struct { + ctx context.Context + watcher *l2.WatcherClient + client *ethclient.Client + confirmations uint64 + stop chan struct{} +} + +// NewL2EventWatcher creates a new instance of L2EventWatcher +func NewL2EventWatcher(ctx context.Context, client *ethclient.Client, cfg *config.L2Config, db database.OrmFactory) (*L2EventWatcher, error) { + watcher, err := l2.NewL2WatcherClient(ctx, client, cfg.Confirmations, cfg.BatchProposerConfig, cfg.RelayerConfig.MessengerContractAddress, db) + if err != nil { + return nil, err + } + return &L2EventWatcher{ + ctx: ctx, + watcher: watcher, + client: client, + confirmations: cfg.Confirmations, + stop: make(chan struct{}), + }, nil +} + +// NewL1EventWatcher creates a new instance of L1EventWatcher +func NewL1EventWatcher(ctx context.Context, client *ethclient.Client, cfg *config.L1Config, db database.OrmFactory) *L1EventWatcher { + wathcer := l1.NewWatcher(ctx, client, cfg.StartHeight, cfg.Confirmations, cfg.L1MessengerAddress, cfg.RollupContractAddress, db) + return &L1EventWatcher{ + ctx: ctx, + watcher: wathcer, + client: client, + stop: make(chan struct{}), + } +} + +// Start runs go routine to fetch contract events on L1 +func (l1w *L1EventWatcher) Start() { + go func() { + ticker := time.NewTicker(10 * time.Second) + defer ticker.Stop() + + for ; true; <-ticker.C { + select { + case <-l1w.stop: + return + + default: + blockNumber, err := l1w.client.BlockNumber(l1w.ctx) + if err != nil { + log.Error("Failed to get block number", "err", err) + continue + } + if err := l1w.watcher.FetchContractEvent(blockNumber); err != nil { + log.Error("Failed to fetch bridge contract", "err", err) + } + } + } + }() +} + +// Stop sends the stop signal to stop chan +func (l1w *L1EventWatcher) Stop() { + l1w.stop <- struct{}{} +} + +// Start runs go routine to fetch contract events on L2 +func (l2w *L2EventWatcher) Start() { + // event fetcher loop + go func() { + ticker := time.NewTicker(3 * time.Second) + defer ticker.Stop() + + for { + select { + case <-l2w.stop: + return + + case <-ticker.C: + // get current height + number, err := l2w.client.BlockNumber(l2w.ctx) + if err != nil { + log.Error("failed to get_BlockNumber", "err", err) + continue + } + + if number >= l2w.confirmations { + number = number - l2w.confirmations + } else { + number = 0 + } + + l2w.watcher.FetchContractEvent(number) + } + } + }() +} + +// Stop sends the stop signal to stop chan +func (l2w *L2EventWatcher) Stop() { + l2w.stop <- struct{}{} +} diff --git a/bridge/multibin/event-watcher/l1watcher.go b/bridge/multibin/event-watcher/l1watcher.go deleted file mode 100644 index 54292a605..000000000 --- a/bridge/multibin/event-watcher/l1watcher.go +++ /dev/null @@ -1,17 +0,0 @@ -package eventwatcher - -import ( - "scroll-tech/bridge/config" - "scroll-tech/bridge/l1" - "scroll-tech/database" -) - -type L1EventWatcher struct { - cfg *config.L1Config - watcher *l1.Watcher - orm database.OrmFactory -} - -func (w *L1EventWatcher) Start() { - w.watcher.Start() -} diff --git a/bridge/multibin/event-watcher/main.go b/bridge/multibin/event-watcher/main.go deleted file mode 100644 index a9c0be3dc..000000000 --- a/bridge/multibin/event-watcher/main.go +++ /dev/null @@ -1 +0,0 @@ -package eventwatcher diff --git a/bridge/multibin/message-relayer/app/app.go b/bridge/multibin/message-relayer/app/app.go index 6eddff2d9..05d762e40 100644 --- a/bridge/multibin/message-relayer/app/app.go +++ b/bridge/multibin/message-relayer/app/app.go @@ -5,7 +5,6 @@ import ( "os" "os/signal" - "github.com/scroll-tech/go-ethereum/ethclient" "github.com/scroll-tech/go-ethereum/log" "github.com/urfave/cli/v2" @@ -15,8 +14,7 @@ import ( "scroll-tech/common/version" "scroll-tech/bridge/config" - "scroll-tech/bridge/l1" - "scroll-tech/bridge/l2" + messagerelayer "scroll-tech/bridge/multibin/message-relayer" ) var ( @@ -54,30 +52,21 @@ func action(ctx *cli.Context) error { log.Crit("failed to init db connection", "err", err) } - l1client, err := ethclient.Dial(cfg.L1Config.Endpoint) - if err != nil { - log.Crit("failed to connect l1 geth", "config file", cfgFile, "error", err) - } - - l2client, err := ethclient.Dial(cfg.L1Config.Endpoint) - if err != nil { - log.Crit("failed to connect l1 geth", "config file", cfgFile, "error", err) - } var ( - l1relayer *l1.Layer1Relayer - l2relayer *l2.Layer2Relayer + l1relayer *messagerelayer.L1MsgRelayer + l2relayer *messagerelayer.L2MsgRelayer ) - l1watcher, err = l1.NewLayer1Relayer(ctx.Context, l1client, int64(cfg.L1Config.Confirmations), ormFactory, cfg.L1Config.RelayerConfig) + l1relayer, err = messagerelayer.NewL1MsgRelayer(ctx.Context, int64(cfg.L1Config.Confirmations), ormFactory, cfg.L1Config.RelayerConfig) if err != nil { log.Crit("failed to create new l1 relayer", "config file", cfgFile, "error", err) } - l2watcher, err = l2.NewLayer2Relayer(ctx.Context, ormFactory, cfg.L2Config.RelayerConfig) + l2relayer, err = messagerelayer.NewL2MsgRelayer(ctx.Context, ormFactory, cfg.L2Config.RelayerConfig) if err != nil { log.Crit("failed to creatw new l2 relayer", "config file", cfgFile, "error", err) } defer func() { - l1watcher.Stop() - l2watcher.Stop() + l1relayer.Stop() + l2relayer.Stop() err = ormFactory.Close() if err != nil { log.Error("can not close ormFactory", "error", err) @@ -85,8 +74,8 @@ func action(ctx *cli.Context) error { }() // Start all modules. - l1watcher.Start() - l2watcher.Start() + l1relayer.Start() + l2relayer.Start() log.Info("Start event-watcher successfully") // Catch CTRL-C to ensure a graceful shutdown. diff --git a/bridge/multibin/message-relayer/cmd/main.go b/bridge/multibin/message-relayer/cmd/main.go new file mode 100644 index 000000000..37960ec97 --- /dev/null +++ b/bridge/multibin/message-relayer/cmd/main.go @@ -0,0 +1,7 @@ +package cmd + +import "scroll-tech/bridge/multibin/message-relayer/app" + +func main() { + app.Run() +} diff --git a/bridge/multibin/message-relayer/message_relayer.go b/bridge/multibin/message-relayer/message_relayer.go new file mode 100644 index 000000000..2edd79a77 --- /dev/null +++ b/bridge/multibin/message-relayer/message_relayer.go @@ -0,0 +1,126 @@ +package messagerelayer + +import ( + "context" + "sync" + "time" + + "github.com/scroll-tech/go-ethereum/log" + + "scroll-tech/bridge/config" + "scroll-tech/bridge/l1" + "scroll-tech/bridge/l2" + "scroll-tech/bridge/sender" + "scroll-tech/database" + "scroll-tech/database/orm" +) + +// L1MsgRelayer wraps l1 relayer for message-relayer bin +type L1MsgRelayer struct { + ctx context.Context + relayer *l1.Layer1Relayer + confirmCh <-chan *sender.Confirmation + stop chan struct{} + db orm.L1MessageOrm +} + +// L2MsgRelayer wraps l2 relayer for message-relayer bin +type L2MsgRelayer struct { + ctx context.Context + relayer *l2.Layer2Relayer + msgConfirmCh <-chan *sender.Confirmation + stop chan struct{} + db orm.L2MessageOrm +} + +// NewL2MsgRelayer creates a new instance of L2MsgRelayer +func NewL2MsgRelayer(ctx context.Context, db database.OrmFactory, cfg *config.RelayerConfig) (*L2MsgRelayer, error) { + msgRelayer, err := l2.NewLayer2Relayer(ctx, db, cfg) + if err != nil { + return nil, err + } + return &L2MsgRelayer{ + ctx: ctx, + relayer: msgRelayer, + msgConfirmCh: msgRelayer.GetMsgConfirmCh(), + db: db, + stop: make(chan struct{}), + }, nil +} + +// NewL1MsgRelayer creates a new instance of L1MsgRelayer +func NewL1MsgRelayer(ctx context.Context, l1ConfirmNum int64, db orm.L1MessageOrm, cfg *config.RelayerConfig) (*L1MsgRelayer, error) { + msgRelayer, err := l1.NewLayer1Relayer(ctx, l1ConfirmNum, db, cfg) + if err != nil { + return nil, err + } + return &L1MsgRelayer{ + ctx: ctx, + relayer: msgRelayer, + confirmCh: msgRelayer.GetConfirmCh(), + stop: make(chan struct{}), + db: db, + }, nil +} + +// Start runs go routine to process saved events on L1 +func (l1r *L1MsgRelayer) Start() { + go func() { + // trigger by timer + ticker := time.NewTicker(3 * time.Second) + defer ticker.Stop() + + for { + select { + case <-ticker.C: + l1r.relayer.ProcessSavedEvents() + case cfm := <-l1r.confirmCh: + if !cfm.IsSuccessful { + log.Warn("transaction confirmed but failed in layer2", "confirmation", cfm) + } else { + // @todo handle db error + err := l1r.db.UpdateLayer1StatusAndLayer2Hash(l1r.ctx, cfm.ID, orm.MsgConfirmed, cfm.TxHash.String()) + if err != nil { + log.Warn("UpdateLayer1StatusAndLayer2Hash failed", "err", err) + } + log.Info("transaction confirmed in layer2", "confirmation", cfm) + } + case <-l1r.stop: + return + } + } + }() +} + +// Stop sends signal to stop chan +func (l1r *L1MsgRelayer) Stop() { + l1r.stop <- struct{}{} +} + +// Start runs go routine to process saved events on L2 +func (l2r *L2MsgRelayer) Start() { + go func() { + // trigger by timer + ticker := time.NewTicker(time.Second) + defer ticker.Stop() + + for { + select { + case <-ticker.C: + var wg = sync.WaitGroup{} + wg.Add(1) + l2r.relayer.ProcessSavedEvents(&wg) + wg.Wait() + case confirmation := <-l2r.msgConfirmCh: + l2r.relayer.HandleConfirmation(confirmation) + case <-l2r.stop: + return + } + } + }() +} + +// Stop sends signal to stop chan +func (l2r *L2MsgRelayer) Stop() { + l2r.stop <- struct{}{} +} diff --git a/bridge/sender/sender.go b/bridge/sender/sender.go index 255042830..86ea1b14d 100644 --- a/bridge/sender/sender.go +++ b/bridge/sender/sender.go @@ -166,6 +166,10 @@ func (s *Sender) getFeeData(auth *bind.TransactOpts, target *common.Address, val // estimate gas price var gasPrice *big.Int gasPrice, err = s.client.SuggestGasPrice(s.ctx) + + gasPrice = gasPrice.Mul(gasPrice, big.NewInt(15)) + gasPrice = gasPrice.Div(gasPrice, big.NewInt(10)) + if err != nil { return nil, err } diff --git a/common/go.mod b/common/go.mod index 0debd6562..9b97f1685 100644 --- a/common/go.mod +++ b/common/go.mod @@ -9,8 +9,8 @@ require ( github.com/mattn/go-colorable v0.1.8 github.com/mattn/go-isatty v0.0.14 github.com/orcaman/concurrent-map v1.0.0 - github.com/scroll-tech/go-ethereum v1.10.14-0.20230112091133-2891916a0f81 - github.com/stretchr/testify v1.8.0 + github.com/scroll-tech/go-ethereum v1.10.14-0.20230127005331-08ba436d8bb3 + github.com/stretchr/testify v1.8.1 github.com/urfave/cli/v2 v2.10.2 ) @@ -67,7 +67,7 @@ require ( github.com/rogpeppe/go-internal v1.8.1 // indirect github.com/rs/cors v1.7.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/scroll-tech/zktrie v0.3.1 // indirect + github.com/scroll-tech/zktrie v0.4.1 // indirect github.com/shirou/gopsutil v3.21.11+incompatible // indirect github.com/sirupsen/logrus v1.9.0 // indirect github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4 // indirect diff --git a/common/go.sum b/common/go.sum index c021aa754..69b33667b 100644 --- a/common/go.sum +++ b/common/go.sum @@ -404,11 +404,11 @@ github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/scroll-tech/go-ethereum v1.10.14-0.20230112091133-2891916a0f81 h1:Gm18RZ9WTR2Dupumr60E2m1Noe+l9/lITt6iRyxxZoc= -github.com/scroll-tech/go-ethereum v1.10.14-0.20230112091133-2891916a0f81/go.mod h1:jurIpDQ0hqtp9//xxeWzr8X9KMP/+TYn+vz3K1wZrv0= +github.com/scroll-tech/go-ethereum v1.10.14-0.20230127005331-08ba436d8bb3 h1:kYPsjs9hr579hMFuHXrOy0zveCLHD/kC+PGv9wnadvM= +github.com/scroll-tech/go-ethereum v1.10.14-0.20230127005331-08ba436d8bb3/go.mod h1:jurIpDQ0hqtp9//xxeWzr8X9KMP/+TYn+vz3K1wZrv0= github.com/scroll-tech/zktrie v0.3.0/go.mod h1:CuJFlG1/soTJJBAySxCZgTF7oPvd5qF6utHOEciC43Q= -github.com/scroll-tech/zktrie v0.3.1 h1:HlR+fMBdjXX1/7cUMqpUgGEhGy/3vN1JpwQ0ovg/Ys8= -github.com/scroll-tech/zktrie v0.3.1/go.mod h1:CuJFlG1/soTJJBAySxCZgTF7oPvd5qF6utHOEciC43Q= +github.com/scroll-tech/zktrie v0.4.1 h1:+enbK4g6/Pj76Do6Pz+ncaqJuYczua+yhP3Phs0pD3E= +github.com/scroll-tech/zktrie v0.4.1/go.mod h1:XvNo7vAk8yxNyTjBDj5WIiFzYW4bx/gJ78+NK6Zn6Uk= github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= github.com/segmentio/kafka-go v0.2.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= diff --git a/common/version/version.go b/common/version/version.go index a52078d61..b3c20ef10 100644 --- a/common/version/version.go +++ b/common/version/version.go @@ -5,7 +5,7 @@ import ( "runtime/debug" ) -var tag = "prealpha-v11.18" +var tag = "prealpha-v11.16" var commit = func() string { if info, ok := debug.ReadBuildInfo(); ok { diff --git a/coordinator/go.mod b/coordinator/go.mod index d93d5f6c6..6a906f7ad 100644 --- a/coordinator/go.mod +++ b/coordinator/go.mod @@ -5,8 +5,8 @@ go 1.18 require ( github.com/orcaman/concurrent-map v1.0.0 github.com/patrickmn/go-cache v2.1.0+incompatible - github.com/scroll-tech/go-ethereum v1.10.14-0.20230112091133-2891916a0f81 - github.com/stretchr/testify v1.8.0 + github.com/scroll-tech/go-ethereum v1.10.14-0.20230127005331-08ba436d8bb3 + github.com/stretchr/testify v1.8.1 github.com/urfave/cli/v2 v2.10.2 golang.org/x/sync v0.1.0 ) @@ -29,7 +29,7 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rogpeppe/go-internal v1.8.1 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/scroll-tech/zktrie v0.3.1 // indirect + github.com/scroll-tech/zktrie v0.4.1 // indirect github.com/shirou/gopsutil v3.21.11+incompatible // indirect github.com/tklauser/go-sysconf v0.3.10 // indirect github.com/tklauser/numcpus v0.4.0 // indirect diff --git a/coordinator/go.sum b/coordinator/go.sum index 54cf6c24d..2154d0619 100644 --- a/coordinator/go.sum +++ b/coordinator/go.sum @@ -349,11 +349,11 @@ github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/scroll-tech/go-ethereum v1.10.14-0.20230112091133-2891916a0f81 h1:Gm18RZ9WTR2Dupumr60E2m1Noe+l9/lITt6iRyxxZoc= -github.com/scroll-tech/go-ethereum v1.10.14-0.20230112091133-2891916a0f81/go.mod h1:jurIpDQ0hqtp9//xxeWzr8X9KMP/+TYn+vz3K1wZrv0= +github.com/scroll-tech/go-ethereum v1.10.14-0.20230127005331-08ba436d8bb3 h1:kYPsjs9hr579hMFuHXrOy0zveCLHD/kC+PGv9wnadvM= +github.com/scroll-tech/go-ethereum v1.10.14-0.20230127005331-08ba436d8bb3/go.mod h1:jurIpDQ0hqtp9//xxeWzr8X9KMP/+TYn+vz3K1wZrv0= github.com/scroll-tech/zktrie v0.3.0/go.mod h1:CuJFlG1/soTJJBAySxCZgTF7oPvd5qF6utHOEciC43Q= -github.com/scroll-tech/zktrie v0.3.1 h1:HlR+fMBdjXX1/7cUMqpUgGEhGy/3vN1JpwQ0ovg/Ys8= -github.com/scroll-tech/zktrie v0.3.1/go.mod h1:CuJFlG1/soTJJBAySxCZgTF7oPvd5qF6utHOEciC43Q= +github.com/scroll-tech/zktrie v0.4.1 h1:+enbK4g6/Pj76Do6Pz+ncaqJuYczua+yhP3Phs0pD3E= +github.com/scroll-tech/zktrie v0.4.1/go.mod h1:XvNo7vAk8yxNyTjBDj5WIiFzYW4bx/gJ78+NK6Zn6Uk= github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= github.com/segmentio/kafka-go v0.2.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= diff --git a/database/go.mod b/database/go.mod index e1b33769e..56356e2b7 100644 --- a/database/go.mod +++ b/database/go.mod @@ -7,8 +7,9 @@ require ( github.com/lib/pq v1.10.6 github.com/mattn/go-sqlite3 v1.14.14 github.com/pressly/goose/v3 v3.7.0 - github.com/scroll-tech/go-ethereum v1.10.14-0.20230112091133-2891916a0f81 - github.com/stretchr/testify v1.8.0 + github.com/redis/go-redis/v9 v9.0.0-rc.4 + github.com/scroll-tech/go-ethereum v1.10.14-0.20230127005331-08ba436d8bb3 + github.com/stretchr/testify v1.8.1 github.com/urfave/cli/v2 v2.10.2 ) @@ -24,7 +25,7 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rogpeppe/go-internal v1.8.1 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/scroll-tech/zktrie v0.3.1 // indirect + github.com/scroll-tech/zktrie v0.4.1 // indirect github.com/shirou/gopsutil v3.21.11+incompatible // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect diff --git a/database/go.sum b/database/go.sum index fb04e50e0..d49a89e11 100644 --- a/database/go.sum +++ b/database/go.sum @@ -339,11 +339,11 @@ github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/scroll-tech/go-ethereum v1.10.14-0.20230112091133-2891916a0f81 h1:Gm18RZ9WTR2Dupumr60E2m1Noe+l9/lITt6iRyxxZoc= -github.com/scroll-tech/go-ethereum v1.10.14-0.20230112091133-2891916a0f81/go.mod h1:jurIpDQ0hqtp9//xxeWzr8X9KMP/+TYn+vz3K1wZrv0= +github.com/scroll-tech/go-ethereum v1.10.14-0.20230127005331-08ba436d8bb3 h1:kYPsjs9hr579hMFuHXrOy0zveCLHD/kC+PGv9wnadvM= +github.com/scroll-tech/go-ethereum v1.10.14-0.20230127005331-08ba436d8bb3/go.mod h1:jurIpDQ0hqtp9//xxeWzr8X9KMP/+TYn+vz3K1wZrv0= github.com/scroll-tech/zktrie v0.3.0/go.mod h1:CuJFlG1/soTJJBAySxCZgTF7oPvd5qF6utHOEciC43Q= -github.com/scroll-tech/zktrie v0.3.1 h1:HlR+fMBdjXX1/7cUMqpUgGEhGy/3vN1JpwQ0ovg/Ys8= -github.com/scroll-tech/zktrie v0.3.1/go.mod h1:CuJFlG1/soTJJBAySxCZgTF7oPvd5qF6utHOEciC43Q= +github.com/scroll-tech/zktrie v0.4.1 h1:+enbK4g6/Pj76Do6Pz+ncaqJuYczua+yhP3Phs0pD3E= +github.com/scroll-tech/zktrie v0.4.1/go.mod h1:XvNo7vAk8yxNyTjBDj5WIiFzYW4bx/gJ78+NK6Zn6Uk= github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= github.com/segmentio/kafka-go v0.2.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= diff --git a/go.work.sum b/go.work.sum index 803268bb7..2fbab2ede 100644 --- a/go.work.sum +++ b/go.work.sum @@ -66,6 +66,8 @@ github.com/c-bata/go-prompt v0.2.2 h1:uyKRz6Z6DUyj49QVijyM339UJV9yhbr70gESwbNU3e github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= github.com/census-instrumentation/opencensus-proto v0.2.1 h1:glEXhBS5PSLLv4IXzLA5yPRVX4bilULVyxxbrfOtDAk= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8= @@ -137,6 +139,7 @@ github.com/golangci/lint-1 v0.0.0-20181222135242-d2cdd8c08219 h1:utua3L2IbQJmauC github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= github.com/google/flatbuffers v1.11.0 h1:O7CEyB8Cb3/DmtxODGtLHcEvpr81Jm5qLg/hsHnxA2A= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa h1:Q75Upo5UN4JbPFURXZ8nLKYUvF85dyFRop/vQ0Rv+64= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc h1:DLpL8pWq0v4JYoRpEhDfsJhhJyGKCcQM2WPW2TJs31c= @@ -220,14 +223,11 @@ github.com/prometheus/client_golang v1.0.0 h1:vrDKnkGzuGvhNAL56c7DBz29ZL+KxnoR0x github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM= github.com/prometheus/common v0.6.0 h1:kRhiuYSXR3+uv2IbVbZhUxK5zVD/2pp3Gd2PpvPkpEo= github.com/prometheus/procfs v0.0.2 h1:6LJUbpNm42llc4HRCuvApCSWB/WfhuNo9K98Q9sNGfs= +github.com/redis/go-redis/v9 v9.0.0-rc.4/go.mod h1:Vo3EsyWnicKnSKCA7HhgnvnyA74wOA69Cd2Meli5mmA= github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52 h1:RnWNS9Hlm8BIkjr6wx8li5abe0fr73jljLycdfemTp0= github.com/scroll-tech/go-ethereum v1.10.14-0.20221202061207-804e7edc23ba/go.mod h1:jurIpDQ0hqtp9//xxeWzr8X9KMP/+TYn+vz3K1wZrv0= github.com/scroll-tech/go-ethereum v1.10.14-0.20221213034543-78c1f57fcfea/go.mod h1:jurIpDQ0hqtp9//xxeWzr8X9KMP/+TYn+vz3K1wZrv0= github.com/scroll-tech/go-ethereum v1.10.14-0.20221221073256-5ca70bf3a257/go.mod h1:jurIpDQ0hqtp9//xxeWzr8X9KMP/+TYn+vz3K1wZrv0= -github.com/scroll-tech/go-ethereum v1.10.14-0.20230127005331-08ba436d8bb3 h1:kYPsjs9hr579hMFuHXrOy0zveCLHD/kC+PGv9wnadvM= -github.com/scroll-tech/go-ethereum v1.10.14-0.20230127005331-08ba436d8bb3/go.mod h1:jurIpDQ0hqtp9//xxeWzr8X9KMP/+TYn+vz3K1wZrv0= -github.com/scroll-tech/zktrie v0.4.1 h1:+enbK4g6/Pj76Do6Pz+ncaqJuYczua+yhP3Phs0pD3E= -github.com/scroll-tech/zktrie v0.4.1/go.mod h1:XvNo7vAk8yxNyTjBDj5WIiFzYW4bx/gJ78+NK6Zn6Uk= github.com/segmentio/kafka-go v0.2.0 h1:HtCSf6B4gN/87yc5qTl7WsxPKQIIGXLPPM1bMCPOsoY= github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= @@ -263,6 +263,7 @@ go.uber.org/atomic v1.3.2 h1:2Oa65PReHzfn29GpvgsYwloV9AVFHPDk8tYxt2c2tr4= go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= go.uber.org/zap v1.9.1 h1:XCJQEf3W6eZaVwhRBof6ImoYGJSITeKWsyeh3HFu/5o= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.4.0/go.mod h1:3quD/ATkf6oY+rnes5c3ExXTbLc8mueNue5/DoinL80= golang.org/x/exp v0.0.0-20191227195350-da58074b4299 h1:zQpM52jfKHG6II1ISZY1ZcpygvuSFZpLwfluuF89XOg= golang.org/x/exp v0.0.0-20220426173459-3bcf042a4bf5 h1:rxKZ2gOnYxjfmakvUUqh9Gyb6KXfrj7JWTxORTYqb0E= golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4= @@ -276,6 +277,7 @@ golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.3.0 h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI= golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= @@ -292,6 +294,7 @@ google.golang.org/grpc v1.26.0 h1:2dTRdpdFEEhJYQD8EMLB61nnrzSCTbG38PhqdhvOltg= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= gopkg.in/errgo.v2 v2.1.0 h1:0vLT13EuvQ0hNvakwLuFZ/jYrLp5F3kcWHXdRggjCE8= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= @@ -299,6 +302,5 @@ gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6 h1:a6cXbcDDUk gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= honnef.co/go/tools v0.1.3 h1:qTakTkI6ni6LFD5sBwwsdSO+AQqbSIxOauHTTQKZ/7o= -modernc.org/mathutil v1.4.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= rsc.io/binaryregexp v0.2.0 h1:HfqmD5MEmC0zvwBuF187nq9mdnXjXsSivRiXN7SmRkE= rsc.io/pdf v0.1.1 h1:k1MczvYDUvJBe93bYd7wrZLLUEcLZAuF824/I4e5Xr4= diff --git a/roller/go.mod b/roller/go.mod index bbd62fb14..6f80e3710 100644 --- a/roller/go.mod +++ b/roller/go.mod @@ -3,8 +3,8 @@ module scroll-tech/roller go 1.18 require ( - github.com/scroll-tech/go-ethereum v1.10.14-0.20230112091133-2891916a0f81 - github.com/stretchr/testify v1.8.0 + github.com/scroll-tech/go-ethereum v1.10.14-0.20230127005331-08ba436d8bb3 + github.com/stretchr/testify v1.8.1 github.com/urfave/cli/v2 v2.10.2 go.etcd.io/bbolt v1.3.6 ) @@ -21,7 +21,7 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rogpeppe/go-internal v1.8.1 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/scroll-tech/zktrie v0.3.1 // indirect + github.com/scroll-tech/zktrie v0.4.1 // indirect github.com/shirou/gopsutil v3.21.11+incompatible // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect diff --git a/roller/go.sum b/roller/go.sum index d93558950..3b30a6362 100644 --- a/roller/go.sum +++ b/roller/go.sum @@ -323,11 +323,11 @@ github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/scroll-tech/go-ethereum v1.10.14-0.20230112091133-2891916a0f81 h1:Gm18RZ9WTR2Dupumr60E2m1Noe+l9/lITt6iRyxxZoc= -github.com/scroll-tech/go-ethereum v1.10.14-0.20230112091133-2891916a0f81/go.mod h1:jurIpDQ0hqtp9//xxeWzr8X9KMP/+TYn+vz3K1wZrv0= +github.com/scroll-tech/go-ethereum v1.10.14-0.20230127005331-08ba436d8bb3 h1:kYPsjs9hr579hMFuHXrOy0zveCLHD/kC+PGv9wnadvM= +github.com/scroll-tech/go-ethereum v1.10.14-0.20230127005331-08ba436d8bb3/go.mod h1:jurIpDQ0hqtp9//xxeWzr8X9KMP/+TYn+vz3K1wZrv0= github.com/scroll-tech/zktrie v0.3.0/go.mod h1:CuJFlG1/soTJJBAySxCZgTF7oPvd5qF6utHOEciC43Q= -github.com/scroll-tech/zktrie v0.3.1 h1:HlR+fMBdjXX1/7cUMqpUgGEhGy/3vN1JpwQ0ovg/Ys8= -github.com/scroll-tech/zktrie v0.3.1/go.mod h1:CuJFlG1/soTJJBAySxCZgTF7oPvd5qF6utHOEciC43Q= +github.com/scroll-tech/zktrie v0.4.1 h1:+enbK4g6/Pj76Do6Pz+ncaqJuYczua+yhP3Phs0pD3E= +github.com/scroll-tech/zktrie v0.4.1/go.mod h1:XvNo7vAk8yxNyTjBDj5WIiFzYW4bx/gJ78+NK6Zn6Uk= github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= github.com/segmentio/kafka-go v0.2.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= diff --git a/tests/integration-test/go.mod b/tests/integration-test/go.mod index 33db147f4..85a8ce79d 100644 --- a/tests/integration-test/go.mod +++ b/tests/integration-test/go.mod @@ -3,8 +3,8 @@ module scroll-tech/integration-test go 1.18 require ( - github.com/scroll-tech/go-ethereum v1.10.14-0.20221221073256-5ca70bf3a257 - github.com/stretchr/testify v1.8.0 + github.com/scroll-tech/go-ethereum v1.10.14-0.20230127005331-08ba436d8bb3 + github.com/stretchr/testify v1.8.1 ) require ( diff --git a/tests/integration-test/go.sum b/tests/integration-test/go.sum index bd8eabc66..8c64be1d3 100644 --- a/tests/integration-test/go.sum +++ b/tests/integration-test/go.sum @@ -304,7 +304,7 @@ github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XF github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/scroll-tech/go-ethereum v1.10.14-0.20221221073256-5ca70bf3a257 h1:FjBC0Ww42WRoiB5EQFxoIEcJqoEUw2twdhN9nGkVCQA= +github.com/scroll-tech/go-ethereum v1.10.14-0.20230127005331-08ba436d8bb3 h1:kYPsjs9hr579hMFuHXrOy0zveCLHD/kC+PGv9wnadvM= github.com/scroll-tech/zktrie v0.3.0/go.mod h1:CuJFlG1/soTJJBAySxCZgTF7oPvd5qF6utHOEciC43Q= github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= github.com/segmentio/kafka-go v0.2.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo=