From bb624ab1c5d7c4bf117119a7a60cac73376074ae Mon Sep 17 00:00:00 2001 From: teko <160625009+taiko-kitty@users.noreply.github.com> Date: Fri, 23 Feb 2024 09:55:34 -0500 Subject: [PATCH 1/2] chore(main): release bridge-ui 2.9.2 (#16013) --- .release-please-manifest.json | 2 +- packages/bridge-ui/CHANGELOG.md | 8 ++++++++ packages/bridge-ui/package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 0d19ed968f5..7cb808f6e37 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,6 +1,6 @@ { "packages/branding": "0.3.0", - "packages/bridge-ui": "2.9.1", + "packages/bridge-ui": "2.9.2", "packages/eventindexer": "0.13.0", "packages/fork-diff": "0.4.0", "packages/guardian-prover-health-check": "0.1.0", diff --git a/packages/bridge-ui/CHANGELOG.md b/packages/bridge-ui/CHANGELOG.md index 8f8390975f6..c2d674fbb0a 100644 --- a/packages/bridge-ui/CHANGELOG.md +++ b/packages/bridge-ui/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [2.9.2](https://github.com/taikoxyz/taiko-mono/compare/bridge-ui-v2.9.1...bridge-ui-v2.9.2) (2024-02-23) + + +### Bug Fixes + +* **bridge-ui:** add injected provider to connectors ([#16008](https://github.com/taikoxyz/taiko-mono/issues/16008)) ([0496ff4](https://github.com/taikoxyz/taiko-mono/commit/0496ff40e374354b83d17121e4760391fed90a31)) +* **bridge-ui:** renamed configuredCustomToken to configuredCustomTokens ([#15905](https://github.com/taikoxyz/taiko-mono/issues/15905)) ([a9f60b8](https://github.com/taikoxyz/taiko-mono/commit/a9f60b8c114dfd277e8dc227e7fbbe8716698d53)) + ## [2.9.1](https://github.com/taikoxyz/taiko-mono/compare/bridge-ui-v2.9.0...bridge-ui-v2.9.1) (2024-02-22) diff --git a/packages/bridge-ui/package.json b/packages/bridge-ui/package.json index 3d8d12f7811..f3394f1b3ca 100644 --- a/packages/bridge-ui/package.json +++ b/packages/bridge-ui/package.json @@ -1,6 +1,6 @@ { "name": "bridge-ui", - "version": "2.9.1", + "version": "2.9.2", "private": true, "scripts": { "dev": "vite dev", From d54172c5f677ad60c48ef0ababc54a968e6a58c9 Mon Sep 17 00:00:00 2001 From: xiaodino Date: Fri, 23 Feb 2024 10:02:52 -0800 Subject: [PATCH 2/2] chore(relayer): add TargetBlock in indexer (#15921) Co-authored-by: Daniel Wang <99078276+dantaik@users.noreply.github.com> Co-authored-by: maskpp Co-authored-by: jeff <113397187+cyberhorsey@users.noreply.github.com> --- packages/relayer/cmd/flags/indexer.go | 8 ++++++ packages/relayer/indexer/config.go | 8 ++++++ packages/relayer/indexer/indexer.go | 27 ++++++++++++++------ packages/relayer/pkg/queue/rabbitmq/queue.go | 2 -- packages/relayer/processor/process_single.go | 2 +- 5 files changed, 36 insertions(+), 11 deletions(-) diff --git a/packages/relayer/cmd/flags/indexer.go b/packages/relayer/cmd/flags/indexer.go index a28f2d0a57e..dc819ceeadd 100644 --- a/packages/relayer/cmd/flags/indexer.go +++ b/packages/relayer/cmd/flags/indexer.go @@ -76,6 +76,13 @@ var ( Category: indexerCategory, EnvVars: []string{"NUM_LATEST_BLOCKS_TO_IGNORE_WHEN_CRAWLING"}, } + TargetBlockNumber = &cli.Uint64Flag{ + Name: "targetBlockNumber", + Usage: "Specify the target block number to process transactions in", + Required: false, + Category: indexerCategory, + EnvVars: []string{"TARGET_BLOCK_NUMBER"}, + } ) var IndexerFlags = MergeFlags(CommonFlags, QueueFlags, []cli.Flag{ @@ -89,4 +96,5 @@ var IndexerFlags = MergeFlags(CommonFlags, QueueFlags, []cli.Flag{ SyncMode, WatchMode, NumLatestBlocksToIgnoreWhenCrawling, + TargetBlockNumber, }) diff --git a/packages/relayer/indexer/config.go b/packages/relayer/indexer/config.go index 55db76ce491..c56b7d4994e 100644 --- a/packages/relayer/indexer/config.go +++ b/packages/relayer/indexer/config.go @@ -40,6 +40,7 @@ type Config struct { SyncMode SyncMode WatchMode WatchMode NumLatestBlocksToIgnoreWhenCrawling uint64 + TargetBlockNumber *uint64 OpenQueueFunc func() (queue.Queue, error) OpenDBFunc func() (DB, error) } @@ -70,6 +71,13 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { SyncMode: SyncMode(c.String(flags.SyncMode.Name)), ETHClientTimeout: c.Uint64(flags.ETHClientTimeout.Name), NumLatestBlocksToIgnoreWhenCrawling: c.Uint64(flags.NumLatestBlocksToIgnoreWhenCrawling.Name), + TargetBlockNumber: func() *uint64 { + if c.IsSet(flags.TargetBlockNumber.Name) { + value := c.Uint64(flags.TargetBlockNumber.Name) + return &value + } + return nil + }(), OpenDBFunc: func() (DB, error) { return db.OpenDBConnection(db.DBConnectionOpts{ Name: c.String(flags.DatabaseUsername.Name), diff --git a/packages/relayer/indexer/indexer.go b/packages/relayer/indexer/indexer.go index 8c2f2cc23f2..ac5005db85d 100644 --- a/packages/relayer/indexer/indexer.go +++ b/packages/relayer/indexer/indexer.go @@ -95,6 +95,8 @@ type Indexer struct { numLatestBlocksToIgnoreWhenCrawling uint64 + targetBlockNumber *uint64 + ctx context.Context mu *sync.Mutex @@ -194,6 +196,8 @@ func InitFromConfig(ctx context.Context, i *Indexer, cfg *Config) (err error) { i.numLatestBlocksToIgnoreWhenCrawling = cfg.NumLatestBlocksToIgnoreWhenCrawling + i.targetBlockNumber = cfg.TargetBlockNumber + i.mu = &sync.Mutex{} return nil @@ -273,21 +277,28 @@ func (i *Indexer) filter(ctx context.Context) error { return i.subscribe(ctx, i.srcChainId) } - slog.Info("fetching batch block events", - "chainID", i.srcChainId.Uint64(), - "startblock", i.processingBlockHeight, - "endblock", header.Number.Int64(), - "batchsize", i.blockBatchSize, - ) - endBlockID := header.Number.Uint64() // ignore latest N blocks, they are probably in queue already // and are not "missed". if i.watchMode == CrawlPastBlocks { - endBlockID -= i.numLatestBlocksToIgnoreWhenCrawling + if i.targetBlockNumber != nil { + slog.Info("targetBlockNumber is set", "targetBlockNumber", *i.targetBlockNumber) + i.processingBlockHeight = *i.targetBlockNumber + endBlockID = i.processingBlockHeight + 1 + } else { + endBlockID = i.numLatestBlocksToIgnoreWhenCrawling + } } + slog.Info("fetching batch block events", + "chainID", i.srcChainId.Uint64(), + "processingBlockHeight", i.processingBlockHeight, + "endblock", endBlockID, + "batchsize", i.blockBatchSize, + "watchMode", i.watchMode, + ) + for j := i.processingBlockHeight; j < endBlockID; j += i.blockBatchSize { end := i.processingBlockHeight + i.blockBatchSize // if the end of the batch is greater than the latest block number, set end diff --git a/packages/relayer/pkg/queue/rabbitmq/queue.go b/packages/relayer/pkg/queue/rabbitmq/queue.go index 95012e99414..704e00b91d1 100644 --- a/packages/relayer/pkg/queue/rabbitmq/queue.go +++ b/packages/relayer/pkg/queue/rabbitmq/queue.go @@ -163,8 +163,6 @@ func (r *RabbitMQ) Ack(ctx context.Context, msg queue.Message) error { err := rmqMsg.Ack(false) - slog.Info("attempted acknowledge rabbitmq message") - if err != nil { slog.Error("error acknowledging rabbitmq message", "err", err.Error()) return err diff --git a/packages/relayer/processor/process_single.go b/packages/relayer/processor/process_single.go index 8c220b0eaba..4244aa0cc0d 100644 --- a/packages/relayer/processor/process_single.go +++ b/packages/relayer/processor/process_single.go @@ -14,7 +14,7 @@ import ( ) func (p *Processor) processSingle(ctx context.Context) error { - slog.Info("processing tx", "estimateGas", common.Hash(*p.targetTxHash).Hex()) + slog.Info("processing single", "txHash", common.Hash(*p.targetTxHash).Hex()) bridgeAbi, err := abi.JSON(strings.NewReader(bridge.BridgeABI)) if err != nil {