Skip to content

Active sequncer periodic report of filter-set-id NIT-4689#4598

Open
mahdy-nasr wants to merge 9 commits intomasterfrom
sequncer-periodically-report-set-id-addressfiltering
Open

Active sequncer periodic report of filter-set-id NIT-4689#4598
mahdy-nasr wants to merge 9 commits intomasterfrom
sequncer-periodically-report-set-id-addressfiltering

Conversation

@mahdy-nasr
Copy link
Copy Markdown
Contributor

Implements NIT-4689. The active sequencer periodically POSTs the current address filter set ID to an external endpoint via the transaction-filterer API.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 3, 2026

Codecov Report

❌ Patch coverage is 4.21053% with 91 lines in your changes missing coverage. Please review.
✅ Project coverage is 33.64%. Comparing base (c2d3d0a) to head (c70dcf0).
⚠️ Report is 18 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4598      +/-   ##
==========================================
- Coverage   33.82%   33.64%   -0.18%     
==========================================
  Files         499      500       +1     
  Lines       60170    60262      +92     
==========================================
- Hits        20350    20277      -73     
- Misses      36272    36432     +160     
- Partials     3548     3553       +5     

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

❌ 10 Tests Failed:

Tests completed Failed Passed Skipped
4936 10 4926 0
View the top 3 failed tests by shortest run time
TestEndToEnd_ManyEvilValidators
Stack Traces | -0.000s run time
... [CONTENT TRUNCATED: Keeping last 20 lines]
created by github.com/offchainlabs/nitro/bold/containers/events.(*Producer[...]).Broadcast in goroutine 219958
	/home/runner/work/nitro/nitro/bold/containers/events/producer.go:106 +0x10a

goroutine 5543131 [select]:
github.com/offchainlabs/nitro/bold/containers/events.(*Producer[...]).Broadcast.func1()
	/home/runner/work/nitro/nitro/bold/containers/events/producer.go:107 +0xd9
created by github.com/offchainlabs/nitro/bold/containers/events.(*Producer[...]).Broadcast in goroutine 219955
	/home/runner/work/nitro/nitro/bold/containers/events/producer.go:106 +0x10a

goroutine 5543136 [select]:
github.com/offchainlabs/nitro/bold/containers/events.(*Producer[...]).Broadcast.func1()
	/home/runner/work/nitro/nitro/bold/containers/events/producer.go:107 +0xd9
created by github.com/offchainlabs/nitro/bold/containers/events.(*Producer[...]).Broadcast in goroutine 219955
	/home/runner/work/nitro/nitro/bold/containers/events/producer.go:106 +0x10a

goroutine 5543751 [select]:
github.com/offchainlabs/nitro/bold/containers/events.(*Producer[...]).Broadcast.func1()
	/home/runner/work/nitro/nitro/bold/containers/events/producer.go:107 +0xd9
created by github.com/offchainlabs/nitro/bold/containers/events.(*Producer[...]).Broadcast in goroutine 219949
	/home/runner/work/nitro/nitro/bold/containers/events/producer.go:106 +0x10a
TestEndToEnd_ManyEvilValidators/honest_essential_edges_confirmed_by_challenge_win
Stack Traces | -0.000s run time
... [CONTENT TRUNCATED: Keeping last 20 lines]
created by github.com/offchainlabs/nitro/bold/containers/events.(*Producer[...]).Broadcast in goroutine 219958
	/home/runner/work/nitro/nitro/bold/containers/events/producer.go:106 +0x10a

goroutine 5543131 [select]:
github.com/offchainlabs/nitro/bold/containers/events.(*Producer[...]).Broadcast.func1()
	/home/runner/work/nitro/nitro/bold/containers/events/producer.go:107 +0xd9
created by github.com/offchainlabs/nitro/bold/containers/events.(*Producer[...]).Broadcast in goroutine 219955
	/home/runner/work/nitro/nitro/bold/containers/events/producer.go:106 +0x10a

goroutine 5543136 [select]:
github.com/offchainlabs/nitro/bold/containers/events.(*Producer[...]).Broadcast.func1()
	/home/runner/work/nitro/nitro/bold/containers/events/producer.go:107 +0xd9
created by github.com/offchainlabs/nitro/bold/containers/events.(*Producer[...]).Broadcast in goroutine 219955
	/home/runner/work/nitro/nitro/bold/containers/events/producer.go:106 +0x10a

goroutine 5543751 [select]:
github.com/offchainlabs/nitro/bold/containers/events.(*Producer[...]).Broadcast.func1()
	/home/runner/work/nitro/nitro/bold/containers/events/producer.go:107 +0xd9
created by github.com/offchainlabs/nitro/bold/containers/events.(*Producer[...]).Broadcast in goroutine 219949
	/home/runner/work/nitro/nitro/bold/containers/events/producer.go:106 +0x10a
TestMELMigrationFromLegacyNode
Stack Traces | 11.130s run time
... [CONTENT TRUNCATED: Keeping last 20 lines]
INFO [04-17|13:28:24.569] Updated payload                          id=0x032e37ee20392410 number=524 hash=979a98..f26e99 txs=1  withdrawals=0 gas=21000      fees=0.0021         root=5211e2..7e876e elapsed="806.874µs"
INFO [04-17|13:28:24.570] Log index head rendering in progress     firstblock=0 lastblock=34  processed=1  remaining=0   elapsed=1.004s
INFO [04-17|13:28:24.570] Log index head rendering finished        firstblock=0 lastblock=34  processed=1  elapsed=1.004s
INFO [04-17|13:28:24.570] Transaction pool stopped
INFO [04-17|13:28:24.570] Stopping work on payload                 id=0x032e37ee20392410 reason=delivery
INFO [04-17|13:28:24.570] Persisting dirty state                   head=35  root=e1d1ad..243632 layers=35
INFO [04-17|13:28:24.571] Imported new potential chain segment     number=64  hash=1b690c..31db26 blocks=1  txs=1  mgas=0.021  elapsed=300.952ms    mgasps=0.070    triediffs=295.85KiB  triedirty=0.00B
INFO [04-17|13:28:24.574] Chain head was updated                   number=64  hash=1b690c..31db26 root=65d065..c894a1 elapsed="77.244µs"
INFO [04-17|13:28:24.577] Imported new potential chain segment     number=524 hash=979a98..f26e99 blocks=1  txs=1  mgas=0.021  elapsed=7.607ms      mgasps=2.760    triediffs=669.19KiB  triedirty=229.11KiB
INFO [04-17|13:28:24.577] Chain head was updated                   number=524 hash=979a98..f26e99 root=5211e2..7e876e elapsed="59.661µs"
INFO [04-17|13:28:24.578] Persisted dirty state to disk            size=162.14KiB elapsed=8.548ms
INFO [04-17|13:28:24.579] Blockchain stopped
INFO [04-17|13:28:24.579] HTTP server stopped                      endpoint=127.0.0.1:46381
TRACE[04-17|13:28:24.579] P2P networking is spinning down
INFO [04-17|13:28:24.583] Submitted transaction                    hash=0xeda8494fc0c7c0f431c6778f9f586d4248904ea2acedea038761ba7f22ec40c4 from=0xaF24Ca6c2831f4d4F629418b50C227DF0885613A nonce=51  recipient=0x7E23C8862920797d81916d62c274dd9217113e28 value=1,000,000,000,000
INFO [04-17|13:28:24.584] Submitted transaction                    hash=0x4f80c44cb01a84c8140146ac8ff2ec58e9ae2ef03e649728ed08ad620d3d52db from=0xaF24Ca6c2831f4d4F629418b50C227DF0885613A nonce=27  recipient=0xaF24Ca6c2831f4d4F629418b50C227DF0885613A value=1,000,000,000,000
INFO [04-17|13:28:24.585] Starting work on payload                 id=0x0341d7cd06489f64
INFO [04-17|13:28:24.586] Updated payload                          id=0x0341d7cd06489f64 number=65  hash=321cef..fb4031 txs=1  withdrawals=0 gas=21000      fees=0.00209935655  root=9e4825..f89492 elapsed="593.537µs"
INFO [04-17|13:28:24.587] Stopping work on payload                 id=0x0341d7cd06489f64 reason=delivery
--- FAIL: TestMELMigrationFromLegacyNode (11.13s)

📣 Thoughts on this report? Let Codecov know! | Powered by Codecov

@joshuacolvin0
Copy link
Copy Markdown
Member

joshuacolvin0 commented Apr 6, 2026

Unit tests are failing. Asking copilot, it stated that failures are likely caused by this PR.
PR Review Summary

Critical Issues (2 found)

  1. Broken test cases in TestParseHashListJSON — execution/gethexec/addressfilter/service_test.go
    Multiple sub-test payloads (sha256Payload, unknownSchemePayload, prefixedPayload, noSchemePayload) are missing the now-required "id" field. uuid.Parse("") will fail, causing
    these tests to error before reaching the assertions they're supposed to test. The error-case payloads (invalidHashPayload, wrongLenPayload) also lack id, meaning they'll fail
    with the wrong error. Verify by running: go test ./execution/gethexec/addressfilter/ -run TestParseHashListJSON -v -count=1
  2. http.DefaultClient used without timeout — cmd/transaction-filterer/api/api.go:73
    ReportCurrentFilterSetId uses http.DefaultClient which has no timeout. The context comes from CallIteratively's long-lived lifecycle context, so a hanging external endpoint
    will freeze the reporting goroutine for the entire node lifetime. Fix: use context.WithTimeout or a custom http.Client{Timeout: 30 * time.Second}.

Important Issues (6 found)

  1. Salt UUID parse error lacks context wrapping — execution/gethexec/addressfilter/s3_sync.go:93-94
    uuid.Parse(payload.Salt) error returned bare (return nil, err) while the adjacent id parse error is properly wrapped. An operator would see "failed to parse hash list:
    invalid UUID length: 5" with no indication which field failed. Fix: return nil, fmt.Errorf("invalid salt UUID: %w", err).
  2. uuid.Nil sentinel is fragile — execution/gethexec/addressfilter/hash_store.go:78, sequencer.go:1757
    uuid.Nil (00000000-...) is a valid UUID that uuid.Parse accepts. If the provider ever sends a zero UUID as id or salt, filtering silently disables (IsRestricted returns
    false) and reporting silently skips. Fix: reject uuid.Nil in parseHashListJSON or Store.
  3. HTTP response body not read on error — cmd/transaction-filterer/api/api.go:78-80
    On non-2xx status, the body is closed but never read. This discards diagnostic info from the endpoint and degrades connection pool reuse. Fix: body, _ :=
    io.ReadAll(io.LimitReader(resp.Body, 1024)) and include in error message.
  4. FilterSetReportingInterval missing reload:"hot" tag — execution/gethexec/sequencer.go:112
    Sibling fields have reload:"hot", and the runtime code reads the interval dynamically via s.config(), but the tag is missing so hot-reload won't propagate changes.
  5. FilterSetReportingInterval not checked in Validate() — execution/gethexec/sequencer.go:115-126
    Negative values silently fall back to 5 minutes (hardcoded duplicate of the default). Zero doesn't disable reporting. Consider validating in Validate() and treating <= 0 as
    disabled, or at least logging a warning.
  6. Changelog typo — changelog/mnasr-nit-4688.md:2
    id-set-fitler should be filter-set-id (letters transposed, also inconsistent naming with rest of PR).

Suggestions (6 found)

  1. No logging when filterSetId == uuid.Nil — sequencer.go:1757-1759
    If S3 sync is broken and never loads data, the reporting loop silently does nothing forever. A log.Debug would help operators diagnose.
  2. Error message omits endpoint URL — api.go:79
    "unexpected status code: %d" should include the target URL for multi-service debugging.
  3. No unit tests for ReportCurrentFilterSetId API method — api.go:60
    The system test covers the happy path, but error paths (empty endpoint, non-2xx, network failure) lack unit tests.
  4. Only one cross-validation vector for HashWithSalt — hash_store.go:38
    TestHashedAddressCheckerSimple has one provider test vector. Additional vectors would strengthen confidence in the algorithm.
  5. uuid.Parse errors silently discarded in tests — Multiple files
    Several tests use salt, _ := uuid.Parse(...) while others properly use require.NoError. Should be consistent.
  6. HashWithSalt lacks a doc comment — hash_store.go:38
    The string format "{uuid}::0x{hex-addr}" is an undocumented protocol. A comment referencing the provider spec would help maintainers.

Strengths

  • Atomic pointer swap pattern for hashData is well-applied for lock-free concurrent reads
  • Cross-validation with provider test vectors (0x8fb74f22...) catches algorithm divergence
  • TestPeriodicFilterSetIdReporting is a well-structured end-to-end system test with a real httptest server, transaction-filterer stack, and sequencer node
  • HashWithSalt centralization eliminates duplicated hashing logic across call sites
  • Type narrowing from []byte to uuid.UUID for salt is a meaningful improvement

Recommended Action

  1. Fix broken TestParseHashListJSON sub-cases (add "id" field to all test payloads) — blocking
  2. Add request timeout to ReportCurrentFilterSetId HTTP call — blocking
  3. Wrap salt parse error with context — quick fix
  4. Reject uuid.Nil in parseHashListJSON — discuss with team re: backward compatibility
  5. Fix changelog typo
  6. Address remaining suggestions as desired

@mahdy-nasr mahdy-nasr force-pushed the sequncer-periodically-report-set-id-addressfiltering branch from 68c5864 to 9a47028 Compare April 6, 2026 14:32
@mahdy-nasr
Copy link
Copy Markdown
Contributor Author

@joshuacolvin0 unit test was failing by parent branch. fixed there and rebased here.

@mahdy-nasr mahdy-nasr force-pushed the add-filter-set-id-hashstore branch 2 times, most recently from f63cf0f to 38f8b72 Compare April 7, 2026 17:07
Base automatically changed from add-filter-set-id-hashstore to master April 8, 2026 16:58
@diegoximenes diegoximenes requested a review from Copilot April 8, 2026 19:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements NIT-4689 by adding a periodic “current address-filter set ID” report from the active sequencer to an external HTTP endpoint, routed through the transaction-filterer JSON-RPC API. This is supported by propagating a filter-set ID through the address-filter hash list payload and storage.

Changes:

  • Added sequencer-side periodic reporting (configurable interval) that calls transactionfilterer_reportCurrentFilterSetId.
  • Extended address-filter hash list format + in-memory store to track a filter-set ID and expose it to the sequencer.
  • Added transaction-filterer API support to POST the filter-set ID to a configured external endpoint, plus a system test covering the end-to-end flow.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
system_tests/tx_address_filter_test.go Updates test helpers for new hash store signature; adds an end-to-end periodic reporting system test.
system_tests/delayed_message_filter_test.go Updates transaction-filterer stack creation to new NewStack signature.
execution/gethexec/transaction_filterer_client.go Adds RPC client method to call reportCurrentFilterSetId.
execution/gethexec/sequencer.go Adds config + periodic reporting loop; updates test helper to store filter rules with an ID.
execution/gethexec/executionengine.go Exposes getter for the transaction-filterer RPC client.
execution/gethexec/addressfilter/service.go Exposes current filter-set ID from the address-filter service.
execution/gethexec/addressfilter/service_test.go Updates hash store calls + parsing tests for the new payload shape.
execution/gethexec/addressfilter/s3_sync.go Parses id from the S3 payload and stores it in the hash store.
execution/gethexec/addressfilter/hash_store.go Stores filter-set ID alongside salt/hashes and exposes Id().
execution/gethexec/addressfilter/address_checker_test.go Updates hash store calls for new signature.
cmd/transaction-filterer/main.go Adds CLI/config for filter-set-reporting-endpoint and wires it into the API stack.
cmd/transaction-filterer/api/api.go Adds ReportCurrentFilterSetId RPC method that POSTs to an external endpoint; extends NewStack to accept endpoint.
cmd/transaction-filterer/api/api_test.go Updates stack creation to new NewStack signature.
changelog/mnasr-nit-4689.md Adds changelog entry for periodic filter-set ID reporting.
changelog/mnasr-nit-4688.md Adds changelog entry for filter-set ID support in address filter reporting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +97 to +99
id, err := uuid.Parse(payload.Id)
if err != nil {
return nil, fmt.Errorf("invalid filter set ID UUID: %w", err)
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parseHashListJSON now requires an id field and fails if it’s missing. Previously the payload only required salt + address_hashes, so upgrading could cause nodes to fail initialization if the S3 object hasn’t been updated yet. Consider making id optional (e.g., default to uuid.Nil or derive a stable ID from digest) so filtering continues to work even when id is absent, and only reporting is skipped.

Suggested change
id, err := uuid.Parse(payload.Id)
if err != nil {
return nil, fmt.Errorf("invalid filter set ID UUID: %w", err)
id := uuid.Nil
if strings.TrimSpace(payload.Id) != "" {
id, err = uuid.Parse(payload.Id)
if err != nil {
return nil, fmt.Errorf("invalid filter set ID UUID: %w", err)
}

Copilot uses AI. Check for mistakes.
Comment thread execution/gethexec/sequencer.go Outdated
Comment on lines +1746 to +1751
if s.execEngine.GetTransactionFiltererRPCClient() != nil {
s.CallIteratively(func(ctx context.Context) time.Duration {
reportingInterval := s.config().TransactionFiltering.FilterSetReportingInterval
if reportingInterval <= 0 {
return 5 * time.Minute
}
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The interval handling here is ambiguous: filter-set-reporting-interval <= 0 silently falls back to 5 minutes, which makes it impossible to disable reporting by setting 0 and also contradicts the configured value. Consider either (a) treating <=0 as “disabled” (return 0 and skip scheduling) or (b) rejecting non-positive values in config validation / flag parsing so behavior matches user intent.

Suggested change
if s.execEngine.GetTransactionFiltererRPCClient() != nil {
s.CallIteratively(func(ctx context.Context) time.Duration {
reportingInterval := s.config().TransactionFiltering.FilterSetReportingInterval
if reportingInterval <= 0 {
return 5 * time.Minute
}
reportingInterval := s.config().TransactionFiltering.FilterSetReportingInterval
if s.execEngine.GetTransactionFiltererRPCClient() != nil && reportingInterval > 0 {
s.CallIteratively(func(ctx context.Context) time.Duration {

Copilot uses AI. Check for mistakes.
Comment thread cmd/transaction-filterer/api/api.go Outdated
Comment on lines +62 to +67
// add timeout to context to avoid hanging if the endpoint is unresponsive
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
defer cancel()
if t.filterSetReportingEndpoint == "" {
return errors.New("filter set reporting endpoint not configured")
}
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returning an error when filterSetReportingEndpoint is empty will surface as repeated warnings on the sequencer side every reporting interval (since the RPC method exists but can never succeed). If the endpoint is meant to be optional, consider making this a no-op (return nil) when not configured, or otherwise fail fast at startup / config validation so the misconfiguration is caught once rather than producing ongoing noise.

Suggested change
// add timeout to context to avoid hanging if the endpoint is unresponsive
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
defer cancel()
if t.filterSetReportingEndpoint == "" {
return errors.New("filter set reporting endpoint not configured")
}
if t.filterSetReportingEndpoint == "" {
return nil
}
// add timeout to context to avoid hanging if the endpoint is unresponsive
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
defer cancel()

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,2 @@
### Added
- Added periodic reporting to filtered addresses filter set id No newline at end of file
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changelog entry wording is unclear/grammatically incorrect: “reporting to filtered addresses filter set id”. Consider rephrasing to something like “periodic reporting of the address-filter set ID” (and use “ID” capitalization).

Suggested change
- Added periodic reporting to filtered addresses filter set id
- Added periodic reporting of the address-filter set ID for filtered addresses

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,2 @@
### Added
- Added support for id-set-filter for address filter reporting No newline at end of file
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changelog entry uses unclear phrasing (“id-set-filter”) and inconsistent capitalization (“id”). Consider clarifying what was added (e.g., “support for a filter set ID in the address filter payload”) and use “ID” capitalization for readability.

Suggested change
- Added support for id-set-filter for address filter reporting
- Added support for a filter set ID in the address filter reporting payload

Copilot uses AI. Check for mistakes.
@mahdy-nasr mahdy-nasr assigned mahdy-nasr and unassigned diegoximenes Apr 9, 2026
@mahdy-nasr
Copy link
Copy Markdown
Contributor Author

Now this API fully moved to new filter-reporting cmd service.

Copy link
Copy Markdown
Contributor

@MishkaRogachev MishkaRogachev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks solid, just a few questions.

Also, in the addressfilter/service_test.go the invalidHashPayload and wrongLenPayload test cases do not include an id field so they test wrong error path

s.CallIteratively(func(ctx context.Context) time.Duration {
reportingInterval := s.filteringConfigFetcher().FilterSetReportingInterval
if reportingInterval == 0 {
return reportingInterval
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That will retry immediately, so if it's misconfigured to 0 it will eat the whole core. Probably define a const with ~10ms delay

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can just have a reasonable CLI default, and then just trust user's input

if reportingInterval == 0 {
return reportingInterval
}
if s.addressFilterService == nil {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this check could be done just once before looping

IPC genericconf.IPCConfig `koanf:"ipc"`
Auth genericconf.AuthRPCConfig `koanf:"auth"`

FilterSetReportingEndpoint string `koanf:"filter-set-reporting-endpoint"`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use the genericconf.HTTPClientConfig strategy that #4620 is using.

genericconf.HTTPClientConfig was introduced by the SQS PR, which has precedence over this one.
So it is OK to use SQS's PR related branch as the base branch of this one.


type FilteringReportAPI struct{}
type FilteringReportAPI struct {
filterSetReportingEndpoint string
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to https://github.com/OffchainLabs/nitro/pull/4598/changes#r3100471692
Let's hold an http client here instead

if a.filterSetReportingEndpoint == "" {
return errors.New("filter set reporting endpoint not configured")
}
payload, err := json.Marshal(map[string]string{"filterSetId": filterSetId})
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also add the chain id to the payload

AddressFilter: addressfilter.DefaultConfig,
TransactionFiltererRPCClient: DefaultTransactionFiltererRPCClientConfig,
FilteringReportRPCClient: DefaultFilteringReportRPCClientConfig,
FilterSetReportingInterval: 5 * time.Minute,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's reduce this to 1 minute

s.CallIteratively(func(ctx context.Context) time.Duration {
reportingInterval := s.filteringConfigFetcher().FilterSetReportingInterval
if reportingInterval == 0 {
return reportingInterval
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can just have a reasonable CLI default, and then just trust user's input

w.WriteHeader(http.StatusInternalServerError)
return
}
var payload map[string]string
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

builder.execConfig.TransactionFiltering.FilteringReportRPCClient.URL = filteringReportStack.HTTPEndpoint()
builder.execConfig.TransactionFiltering.FilterSetReportingInterval = 500 * time.Millisecond

// Use large MsgLag and SyncInterval to prevent ConsensusExecutionSyncer from overwriting it.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is that needed?

execNode.Sequencer.SetAddressFilterServiceForTest(t, filterService)

// Store filter rules with a known ID so periodic reporting has something to report
execNode.Sequencer.StoreFilterRulesForTest(t, expectedId, uuid.New(), nil, "test-digest")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just calling GetHashStore directly from the filterService just created above?

case <-deadline:
t.Fatalf("timed out waiting for 2 periodic reports, got %d (total count: %d)", len(reports), reportCount.Load())
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also add a scenario in which the filterSetId is updated

if s.addressFilterService == nil {
return reportingInterval
}
// Only report if active sequencer
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create a func (s *Sequencer) isActiveSequencer to improve code readability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants