arbitrum: Return filtered address records from TxFilterer.CheckFiltered#657
arbitrum: Return filtered address records from TxFilterer.CheckFiltered#657MishkaRogachev wants to merge 3 commits intomasterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends Arbitrum transaction address-filtering plumbing so callers can obtain the set of filtered address records directly from gas estimation execution, avoiding re-querying the StateDB when state.ErrArbTxFilter is raised (per NIT-4645 / nitro#4653 context).
Changes:
- Change
core.TxFilterer.CheckFilteredto return([]filter.FilteredAddressRecord, error)instead of justerror. - Update
eth/gasestimator.Run/ internalrunto return filtered address records when the failure isstate.ErrArbTxFilter, while keeping existing behavior for other errors. - Adjust internal call sites (e.g.,
execute) to accommodate the newrunreturn signature.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
eth/gasestimator/gasestimator.go |
Propagates filtered address records alongside state.ErrArbTxFilter from run/Run; updates execute to ignore the new return value. |
core/arbitrum_hooks.go |
Updates the TxFilterer interface so CheckFiltered returns filtered address records. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Public API for gas estimation. Separated to simplify upstream merges. | ||
| func Run(ctx context.Context, call *core.Message, opts *Options) (*core.ExecutionResult, error) { | ||
| // When address filtering trips, the returned records describe the filtered addresses. | ||
| func Run(ctx context.Context, call *core.Message, opts *Options) (*core.ExecutionResult, []filter.FilteredAddressRecord, error) { |
There was a problem hiding this comment.
The exported Run function’s doc comment doesn’t start with the function name, which breaks standard Go doc conventions and can cause lint/doc tooling to miss it. Consider rewriting the comment so the first sentence begins with "Run" and still mentions that filtered address records are returned when filtering trips.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
diegoximenes
left a comment
There was a problem hiding this comment.
LGTM, assigning back to @MishkaRogachev while the related nitro PR is not approved
Part of NIT-4645
Pulled in by OffchainLabs/nitro#4653
Return filtered address records from TxFilterer.CheckFiltered so nitro callers (TxPreChecker) can build a filtered-tx report without re-querying the statedb. gasestimator.Run propagates records only on the ErrArbTxFilter branch.