diff --git a/cmd/sequencer/config/default.yml b/cmd/sequencer/config/default.yml index cc46aec..ff0f3c0 100755 --- a/cmd/sequencer/config/default.yml +++ b/cmd/sequencer/config/default.yml @@ -77,7 +77,7 @@ PEBBLE_SEQUENCER__LarkAlert_Env: PROD PEBBLE_SEQUENCER__LarkAlert_Project: pebble-sequencer PEBBLE_SEQUENCER__LarkAlert_Secret: "" PEBBLE_SEQUENCER__LarkAlert_URL: "" -PEBBLE_SEQUENCER__LarkAlert_Version: v0.2.2-1-gaccdfb7 +PEBBLE_SEQUENCER__LarkAlert_Version: "" PEBBLE_SEQUENCER__Logger_Level: DEBUG PEBBLE_SEQUENCER__MqttBroker_Cert_CA: "" PEBBLE_SEQUENCER__MqttBroker_Cert_Crt: "" diff --git a/pkg/middlewares/blockchain/monitor.go b/pkg/middlewares/blockchain/monitor.go index 1cb3d42..8014be3 100644 --- a/pkg/middlewares/blockchain/monitor.go +++ b/pkg/middlewares/blockchain/monitor.go @@ -137,6 +137,7 @@ func (m *Monitor) run(ctx context.Context) { FromBlock: new(big.Int), ToBlock: new(big.Int), } + step := uint64(1000) for { select { case <-ctx.Done(): @@ -164,7 +165,7 @@ func (m *Monitor) run(ctx context.Context) { if from >= current { goto TryLater } - to = min(current, from+100000) + to = min(current, from+step) filter.FromBlock.SetUint64(from) filter.ToBlock.SetUint64(to) results, err = m.client.FilterLogs(ctx, filter) diff --git a/pkg/middlewares/blockchain/subscription.go b/pkg/middlewares/blockchain/subscription.go index 5fb1275..7e190dd 100644 --- a/pkg/middlewares/blockchain/subscription.go +++ b/pkg/middlewares/blockchain/subscription.go @@ -71,6 +71,7 @@ func (w *watcher) fields(others ...any) []any { } func (w *watcher) run(ctx context.Context) { + step := uint64(1000) for { select { case <-ctx.Done(): @@ -97,7 +98,7 @@ func (w *watcher) run(ctx context.Context) { if from >= current { goto TryLater } - to = min(current, from+100000) + to = min(current, from+step) results, err = w.persist.QueryTxByHeightRange(w.meta, from, to) if err != nil { goto Failed