Skip to content

Add FilterSetID to FilteredAddressRecord#4626

Open
MishkaRogachev wants to merge 9 commits intomasterfrom
add-filtersetid-to-filteredaddressrecord
Open

Add FilterSetID to FilteredAddressRecord#4626
MishkaRogachev wants to merge 9 commits intomasterfrom
add-filtersetid-to-filteredaddressrecord

Conversation

@MishkaRogachev
Copy link
Copy Markdown
Contributor

@MishkaRogachev MishkaRogachev commented Apr 10, 2026

Fixes NIT-4780
Waits #4557
Pulls in OffchainLabs/go-ethereum#648

  • Thread FilterSetID through all FilteredAddressRecord construction sites. HashStore.IsRestricted now returns the
    filter set ID atomically with the restriction check.
  • Remove unused _sender parameter from AddressesForFiltering.

@MishkaRogachev MishkaRogachev changed the base branch from master to update-touchaddress-and-hashedaddresscheckerstateisfiltered April 10, 2026 11:27
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 10, 2026

Codecov Report

❌ Patch coverage is 9.52381% with 38 lines in your changes missing coverage. Please review.
✅ Project coverage is 33.11%. Comparing base (c2d3d0a) to head (00acebc).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4626      +/-   ##
==========================================
- Coverage   33.82%   33.11%   -0.71%     
==========================================
  Files         499      499              
  Lines       60170    60169       -1     
==========================================
- Hits        20350    19925     -425     
- Misses      36272    36694     +422     
- Partials     3548     3550       +2     

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 10, 2026

❌ 15 Tests Failed:

Tests completed Failed Passed Skipped
4931 15 4916 0
View the top 3 failed tests by shortest run time
TestEndToEnd_TwoEvilValidators
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 97698
	/home/runner/work/nitro/nitro/bold/containers/events/producer.go:106 +0x10a

goroutine 2905630 [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 97701
	/home/runner/work/nitro/nitro/bold/containers/events/producer.go:106 +0x10a

goroutine 2905701 [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 97704
	/home/runner/work/nitro/nitro/bold/containers/events/producer.go:106 +0x10a

goroutine 2905732 [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 97701
	/home/runner/work/nitro/nitro/bold/containers/events/producer.go:106 +0x10a
TestEndToEnd_TwoEvilValidators/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 97698
	/home/runner/work/nitro/nitro/bold/containers/events/producer.go:106 +0x10a

goroutine 2905630 [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 97701
	/home/runner/work/nitro/nitro/bold/containers/events/producer.go:106 +0x10a

goroutine 2905701 [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 97704
	/home/runner/work/nitro/nitro/bold/containers/events/producer.go:106 +0x10a

goroutine 2905732 [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 97701
	/home/runner/work/nitro/nitro/bold/containers/events/producer.go:106 +0x10a
TestRedisProduceComplex/one_producer,_all_consumers_are_active
Stack Traces | 1.280s run time
... [CONTENT TRUNCATED: Keeping last 20 lines]
�[36mDEBUG�[0m[04-17|09:51:46.334] consumer: xack                           �[36mcid�[0m=cae94e82-d4d2-4c44-8687-ae116acf0a9e �[36mmessageId�[0m=1776419505194-0
�[36mDEBUG�[0m[04-17|09:51:46.334] consumer: xdel                           �[36mcid�[0m=5ca3399d-80f7-45b7-8c3b-4bd0659bd514 �[36mmessageId�[0m=1776419505172-5
�[36mDEBUG�[0m[04-17|09:51:46.334] Redis stream consuming                   �[36mconsumer_id�[0m=3cfdb9af-7a14-40e5-83b4-2619130dc923 �[36mmessage_id�[0m=1776419505194-1
�[36mDEBUG�[0m[04-17|09:51:46.334] consumer: xdel                           �[36mcid�[0m=cae94e82-d4d2-4c44-8687-ae116acf0a9e �[36mmessageId�[0m=1776419505194-0
�[36mDEBUG�[0m[04-17|09:51:46.334] consumer: setting result                 �[36mcid�[0m=3cfdb9af-7a14-40e5-83b4-2619130dc923 �[36mmsgIdInStream�[0m=1776419505194-1  �[36mresultKeyInRedis�[0m=result-key:stream:56ea68f1-94a7-4e11-9d90-b90cbe2d3d16.1776419505194-1
�[36mDEBUG�[0m[04-17|09:51:46.334] consumer: xack                           �[36mcid�[0m=3cfdb9af-7a14-40e5-83b4-2619130dc923 �[36mmessageId�[0m=1776419505194-1
�[36mDEBUG�[0m[04-17|09:51:46.335] consumer: xdel                           �[36mcid�[0m=3cfdb9af-7a14-40e5-83b4-2619130dc923 �[36mmessageId�[0m=1776419505194-1
�[33mWARN �[0m[04-17|09:51:46.341] XClaimJustID returned empty response when indicating heartbeat �[33mmsgID�[0m=1776419505150-11
�[33mWARN �[0m[04-17|09:51:46.341] XClaimJustID returned empty response when indicating heartbeat �[33mmsgID�[0m=1776419505172-2
�[36mDEBUG�[0m[04-17|09:51:46.341] consumer: xack                           �[36mcid�[0m=af871ccd-7225-46a4-a3be-150410e3acd4 �[36mmessageId�[0m=1776419505155-0
�[36mDEBUG�[0m[04-17|09:51:46.341] consumer: xack                           �[36mcid�[0m=af40a620-7775-4bb2-8aa4-60822f229838 �[36mmessageId�[0m=1776419505171-0
�[36mDEBUG�[0m[04-17|09:51:46.342] consumer: xdel                           �[36mcid�[0m=af871ccd-7225-46a4-a3be-150410e3acd4 �[36mmessageId�[0m=1776419505155-0
�[36mDEBUG�[0m[04-17|09:51:46.342] consumer: xdel                           �[36mcid�[0m=af40a620-7775-4bb2-8aa4-60822f229838 �[36mmessageId�[0m=1776419505171-0
�[36mDEBUG�[0m[04-17|09:51:46.380] checkResponses                           �[36mresponded�[0m=74 �[36merrored�[0m=0 �[36mchecked�[0m=100
�[36mDEBUG�[0m[04-17|09:51:46.385] redis producer: check responses starting
�[31mERROR�[0m[04-17|09:51:46.399] Error from XpendingExt in getting PEL for auto claim �[31merr�[0m="context canceled" �[31mpendingLen�[0m=0
�[31mERROR�[0m[04-17|09:51:46.399] Error from XpendingExt in getting PEL for auto claim �[31merr�[0m="context canceled" �[31mpendingLen�[0m=0
�[31mERROR�[0m[04-17|09:51:46.399] Error from XpendingExt in getting PEL for auto claim �[31merr�[0m="context canceled" �[31mpendingLen�[0m=0
�[31mERROR�[0m[04-17|09:51:46.399] Error from XpendingExt in getting PEL for auto claim �[31merr�[0m="context canceled" �[31mpendingLen�[0m=0
--- FAIL: TestRedisProduceComplex/one_producer,_all_consumers_are_active (1.28s)

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

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

This PR extends address-filtering telemetry by adding a FilterSetID to each FilteredAddressRecord, threading it through filtering/touch points, and removing an unused sender parameter from event-based address extraction.

Changes:

  • Update event-filter address extraction to return FilteredAddressWithReason and drop the unused _sender parameter.
  • Extend HashStore.IsRestricted to return (restricted, filterSetID) from a single snapshot and add HashStore.ID().
  • Update address-touch call sites and tests to use FilteredAddressWithReason, and update filtered-tx report JSON expectations to include filterSetId.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
execution/gethexec/sequencer.go Updates event-log filtering touch flow to new AddressesForFiltering signature and TouchAddress argument type.
execution/gethexec/executionengine.go Updates address-touching helpers and event filter application to use FilteredAddressWithReason.
execution/gethexec/eventfilter/eventfilter.go Removes unused sender parameter; returns FilteredAddressWithReason values for matched rules.
execution/gethexec/eventfilter/eventfilter_test.go Adapts tests to updated AddressesForFiltering signature.
execution/gethexec/addressfilter/service_test.go Updates IsRestricted call sites for new (bool, uuid) return.
execution/gethexec/addressfilter/hash_store.go Changes IsRestricted to return filter set ID atomically with the restriction result; adds ID().
execution/gethexec/addressfilter/filter_report_test.go Updates JSON tests to include filterSetId and populates FilterSetID in records.
execution/gethexec/addressfilter/address_checker.go Threads filter set ID into records produced by hashed address checking; changes TouchAddress to take FilteredAddressWithReason.
execution/gethexec/addressfilter/address_checker_test.go Updates checker tests for new touch type and validates recorded FilterSetID.
arbos/tx_processor.go Updates contract/caller touch points to use FilteredAddressWithReason.
changelog/mrogachev-nit-4780.md Adds changelog entry for FilterSetID propagation.

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

Comment on lines 109 to +116
// If the checker is stopped, conservatively mark filtered
if s.checker.Stopped() {
s.report(nil, true)
record := filter.FilteredAddressRecord{
FilterSetID: s.checker.FilterSetID(),
FilteredAddressWithReason: addr,
}
s.report(&record)
s.pending.Done()
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

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

In the "checker stopped" / "context done" fallback, this now appends a full FilteredAddressRecord even though the address was never checked against the HashStore. Previously this path marked the tx filtered without attributing specific addresses (since the result is unknown). Recording an address+reason here can mislead consumers into thinking the address was definitively restricted, and FilterSetID() may not match the snapshot that would have been used. Consider preserving the old behavior (set filtered=true but do not append a record), or introduce an explicit "unknown/unverified" marker in the record format if you need to surface touched addresses during shutdown.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

Comment on lines +134 to +139
// report records a filtered address. Must only be called for restricted addresses.
func (s *HashedAddressCheckerState) report(record *filter.FilteredAddressRecord) {
s.mu.Lock()
s.filtered = true
s.filteredAddresses = append(s.filteredAddresses, *record)
s.mu.Unlock()
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

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

The comment on report() says it must only be called for restricted addresses, but TouchAddress() calls report() in shutdown/stopped paths where the address restriction status is unknown. Either adjust the shutdown behavior so report() is only used for confirmed restricted addresses, or update the comment/API to reflect that report() can also record conservative/unknown filtering.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

@MishkaRogachev MishkaRogachev marked this pull request as ready for review April 13, 2026 14:50
type workItem struct {
record *filter.FilteredAddressRecord
state *HashedAddressCheckerState
addr filter.FilteredAddressWithReason
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.

Suggested change
addr filter.FilteredAddressWithReason
addr *filter.FilteredAddressWithReason

Comment thread execution/gethexec/addressfilter/address_checker_test.go
Comment thread execution/gethexec/addressfilter/address_checker.go Outdated
Comment thread execution/gethexec/addressfilter/hash_store.go Outdated
Comment thread execution/gethexec/addressfilter/service_test.go Outdated
Comment thread execution/gethexec/addressfilter/address_checker.go Outdated
Comment thread execution/gethexec/addressfilter/address_checker.go Outdated
Comment thread execution/gethexec/addressfilter/address_checker.go
diegoximenes
diegoximenes previously approved these changes Apr 15, 2026
@diegoximenes
Copy link
Copy Markdown
Contributor

LGTM, I will keep it assigned to me while the base branch is not merged

Base automatically changed from update-touchaddress-and-hashedaddresscheckerstateisfiltered to master April 16, 2026 15:23
@diegoximenes diegoximenes dismissed their stale review April 16, 2026 15:23

The base branch was changed.

@diegoximenes diegoximenes removed their assignment Apr 17, 2026
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.

4 participants