-
Notifications
You must be signed in to change notification settings - Fork 2
Add ArbFilteredTransactionsManager precompile #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
MishkaRogachev
wants to merge
8
commits into
main
Choose a base branch
from
create-arbcensoredtransactionsmanager-precompile
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
5de70b8
Add ArbCensoredTransactionsManager precompile
MishkaRogachev 9e9bb9f
ArbOwner: add interfaces to manage transaction censors
MishkaRogachev 43f3f06
Rename: censored -> filtered
MishkaRogachev 38135f2
ArbFilteredTransactionsManager: add events for added/deleted filtered…
MishkaRogachev 422a912
ArbOwner: add setter and getter for transaction filtering feature ena…
MishkaRogachev c1f9e05
Better naming for transaction filterers
MishkaRogachev 3033065
Add events and public methods for transaction filterers
MishkaRogachev 0e45554
ArbOwner and ArbOwnerPublic: polish comments
MishkaRogachev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| // Copyright 2025, Offchain Labs, Inc. | ||
| // For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE | ||
| // SPDX-License-Identifier: BUSL-1.1 | ||
|
|
||
| pragma solidity >=0.4.21 <0.9.0; | ||
|
|
||
| /** | ||
| * @title Enables ability to filter transactions by authorized callers. | ||
| * @notice Authorized callers are added/removed through ArbOwner precompile. | ||
| * Available in ArbOS version 60 and above | ||
| */ | ||
| interface ArbFilteredTransactionsManager { | ||
| /// @notice Emitted when a transaction hash is added to the filtered transactions list. | ||
| event FilteredTransactionAdded(bytes32 indexed txHash); | ||
|
|
||
| /// @notice Emitted when a transaction hash is removed from the filtered transactions list. | ||
| event FilteredTransactionDeleted(bytes32 indexed txHash); | ||
|
|
||
| /// @notice Marks the given transaction hash as filtered | ||
| /// @param txHash The transaction hash to filter | ||
| function addFilteredTransaction( | ||
| bytes32 txHash | ||
| ) external; | ||
|
|
||
| /// @notice Removes filtering mark for the given transaction hash | ||
| /// @param txHash The transaction hash to unfilter | ||
| function deleteFilteredTransaction( | ||
| bytes32 txHash | ||
| ) external; | ||
|
|
||
| /// @notice Checks whether the given transaction hash is filtered | ||
| /// @param txHash The transaction hash to check | ||
| /// @return True if filtered, false otherwise | ||
| function isTransactionFiltered( | ||
| bytes32 txHash | ||
| ) external view returns (bool); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -17,6 +17,12 @@ import {ArbMultiGasConstraintsTypes} from "./ArbMultiGasConstraintsTypes.sol"; | |||||
| * | ||||||
| */ | ||||||
| interface ArbOwner { | ||||||
| /// @notice Emitted when an address is added as a transaction filterer. | ||||||
| event TransactionFiltererAdded(address indexed filterer); | ||||||
|
|
||||||
| /// @notice Emitted when an address is removed as a transaction filterer. | ||||||
| event TransactionFiltererRemoved(address indexed filterer); | ||||||
|
|
||||||
| /// @notice Add account as a chain owner | ||||||
| function addChainOwner( | ||||||
| address newOwner | ||||||
|
|
@@ -41,6 +47,12 @@ interface ArbOwner { | |||||
| uint64 timestamp | ||||||
| ) external; | ||||||
|
|
||||||
| /// @notice Sets the TransactionFilteringFrom time | ||||||
| /// @notice Available in ArbOS version 60 and above | ||||||
| function setTransactionFilteringFrom( | ||||||
| uint64 timestamp | ||||||
| ) external; | ||||||
|
|
||||||
| /// @notice Add account as a native token owner | ||||||
| /// @notice Available in ArbOS version 41 and above | ||||||
| function addNativeTokenOwner( | ||||||
|
|
@@ -63,6 +75,28 @@ interface ArbOwner { | |||||
| /// @notice Available in ArbOS version 41 and above | ||||||
| function getAllNativeTokenOwners() external view returns (address[] memory); | ||||||
|
|
||||||
| /// @notice Add account as a transaction filterer (authorized to use ArbFilteredTransactionsManager) | ||||||
| /// @notice Available in ArbOS version 60 and above | ||||||
| function addTransactionFilterer( | ||||||
| address filterer | ||||||
| ) external; | ||||||
|
|
||||||
| /// @notice Remove account from the list of transaction filterers | ||||||
| /// @notice Available in ArbOS version 60 and above | ||||||
| function removeTransactionFilterer( | ||||||
| address filterer | ||||||
| ) external; | ||||||
|
|
||||||
| /// @notice See if the user is a transaction filterer | ||||||
| /// @notice Available in ArbOS version 60 and above | ||||||
| function isTransactionFilterer( | ||||||
| address filterer | ||||||
| ) external view returns (bool); | ||||||
|
|
||||||
| /// @notice Retrieves the list of transaction filterers | ||||||
|
||||||
| /// @notice Retrieves the list of transaction filterers | |
| /// @notice Retrieves the list of transaction filterers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -37,6 +37,21 @@ interface ArbOwnerPublic { | |||||
| /// @notice Available in ArbOS version 41 and above | ||||||
| function getAllNativeTokenOwners() external view returns (address[] memory); | ||||||
|
|
||||||
| /// @notice Retrieves the timestamp from when the transaction filtering | ||||||
| /// modifications are enabled. | ||||||
| /// @notice Available in ArbOS version 60 and above | ||||||
| function getTransactionFilteringFrom() external view returns (uint64); | ||||||
|
|
||||||
| /// @notice See if the user is a transaction filterer | ||||||
| /// @notice Available in ArbOS version 60 and above | ||||||
| function isTransactionFilterer( | ||||||
| address filterer | ||||||
| ) external view returns (bool); | ||||||
|
|
||||||
| /// @notice Retrieves the list of transaction filterers | ||||||
|
||||||
| /// @notice Retrieves the list of transaction filterers | |
| /// @notice Retrieves the list of transaction filterers |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this going to be public or only usable by authorized filterer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since there is an event that allows this information to be obtained, I think the method should be public so that there is no ambiguity