Skip to content

test: integration supersim revshare#30

Merged
0xDiscotech merged 64 commits into
sc-feat/revshare-setupfrom
test/integration-supersim-revshare
Oct 16, 2025
Merged

test: integration supersim revshare#30
0xDiscotech merged 64 commits into
sc-feat/revshare-setupfrom
test/integration-supersim-revshare

Conversation

@0xChin
Copy link
Copy Markdown
Member

@0xChin 0xChin commented Oct 10, 2025

Closes OPT-1178, OPT-1179, OPT-1180

Integration Base

Created an IntegrationBase test contract that is meant to be used by any task that makes a portal.depositTransaction. It is easy to integrate by recording logs with vm.recordLogs before simulating the task, and then the calls are relayed with _relayAllMessages(uint256 _forkId). If running the test with -vv, there will also be provided logs with links for making a Tenderly simulation of the relay on L2. This one is good for checking gas consumptions in a real scenario

Revenue Share Integration

Super small contract that inherits the IntegrationBase. In the setup it forks mainnet and op (from a Supersim fork). Then there are two tests that simulate the task (which actually runs it) and then relays the messages:

    function test_optInRevenueShare_integration() public {
        string memory configPath = "test/tasks/example/eth/015-revenue-share-upgrade/config.toml";

        // Step 1: Execute L1 transaction recording logs
        vm.recordLogs();
        template.simulate(configPath, new address[](0));

        // Step 2: Relay messages from L1 to L2
        _relayAllMessages(_optimismForkId);
    }

    function test_optOutRevenueShare_integration() public {
        string memory configPath = "test/tasks/example/eth/019-revenueshare-upgrade-opt-out/config.toml";

        // Step 1: Execute L1 transaction recording logs
        vm.recordLogs();
        template.simulate(configPath, new address[](0));

        // Step 2: Relay messages from L1 to L2
        _relayAllMessages(_optimismForkId);
    }

Running the tests

Terminal 1

supersim fork --chains=op --interop.enabled

Terminal 2

forge test --mt test_optInRevenueShare_integration -vv
forge test --mt test_optOutRevenueShare_integration -vv

Comment thread test/integration/RevenueShareIntegration.t.sol Outdated
Comment thread test/integration/RevenueShareIntegration.t.sol
Comment thread test/integration/RevenueShareIntegration.t.sol
@0xChin 0xChin changed the base branch from sc-feat/revshare-setup to chore/initialize-vaults-over-constructor October 16, 2025 16:30
Comment thread test/integration/RevenueShareIntegration.t.sol Outdated
}

// Generate Tenderly simulation link
string memory _tenderlyLink = _generateTenderlyLink(_to, _from, uint256(_gasLimit), _value, _data);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Chad logic spotted

Comment thread test/integration/IntegrationBase.t.sol Outdated
Comment thread test/integration/RevenueShareIntegration.t.sol Outdated
0xChin and others added 3 commits October 16, 2025 17:56
Co-authored-by: Disco <131301107+0xDiscotech@users.noreply.github.com>
Signed-off-by: Chiin <77933451+0xChin@users.noreply.github.com>
Co-authored-by: Disco <131301107+0xDiscotech@users.noreply.github.com>
Signed-off-by: Chiin <77933451+0xChin@users.noreply.github.com>
Base automatically changed from chore/initialize-vaults-over-constructor to sc-feat/revshare-setup October 16, 2025 21:27
@0xDiscotech 0xDiscotech merged commit 944db58 into sc-feat/revshare-setup Oct 16, 2025
1 check passed
@0xDiscotech 0xDiscotech deleted the test/integration-supersim-revshare branch October 16, 2025 21:41
0xDiscotech added a commit that referenced this pull request Nov 18, 2025
…ethereum-optimism#1257)

* feat: add Revenue Share Upgrade Path (#8)

* feat: Deploy FeesDepositor (#15)

* feat: late opt-in template (#21)

* refactor: contracts update creationcode (#23)

* fix: sync (#24)

* test: add require tests for fields on Revenue Sharing templates (#26)

* fix: L2 target ProxyAdmin (#27)

* chore: update cost of upgrades and deployments (#29)

* test: revenue sharing upgrade unit tests (#22)

* test: add basic validation for fees depositor template (#32)

* chore: updates the bytecode for vaults, using initialize (#31)

* test: integration supersim revshare (#30)

* fix: broken simulations

* fix: wrong location of synced regression tests

* test: integration revshare late opt in (#33)

* fix: ir fixes (#38)

* chore: gas costs (#39)

* fix: minors (#46)

* fix: remove vm usage for getCreate2Address utils function (#48)

* feat: descope late opt in (#51)

* feat: add rev share upgrader (#53)

* fix: bash on comment

* fix: forge fmt

* refactor: reduce code size by splitting logic between lib and contract (#59)

* refactor: reduce code size by splitting logic between lib and contract

* chore: remove comment

* chore: remove prefix

* refactor: split library (#60)

* refactor: reduce code size by splitting logic between lib and contract

* chore: remove comment

* chore: remove prefix

* refactor: split library in two to avoid code size error

* feat: regression tests (#61)

* fix: relay typo

* fix: improve template validation checks (#62)

* fix: wrong fee splitter bytecode (#63)

* fix: skip comment

* fix: rename test create two deployer

* chore: add commit

* feat: add upgrader deployment script (#64)

* chore: update gas limits

* refactor: use create two to get a deterministic deployment of the upgrader (#68)

* chore: add todos (#66)

* chore: remove tenderly simulations (#65)

* chore: deploy and update new contract (#67)

* fix: forge fmt (#69)

* chore: fuzz init code on get create2 test (#70)

* feat: deploy revshare mainnet (#71)

* fix: forge fmt (#72)

* chore: add todo comments (#73)

* chore: reduce tenderly gas

Co-authored-by: Maurelian <john@oplabs.co>

* fix: reduce tenderly gas limit on sepolia (#77)

---------

Co-authored-by: IamFlux <175354924+0xiamflux@users.noreply.github.com>
Co-authored-by: Chiin <77933451+0xChin@users.noreply.github.com>
Co-authored-by: 0xchin <alanracciatti1220@gmail.com>
Co-authored-by: Maurelian <john@oplabs.co>
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.

3 participants