Skip to content

Conversation

@gustavoguimaraes
Copy link
Contributor

@gustavoguimaraes gustavoguimaraes commented Mar 25, 2025

Ticket

What does this PR do?

  • Summary:
    Refactor AssertPoster and add tests to it

Breaking changes?

  • Yes:

How can this PR be tested?

Go to metabase-translator/contracts and run forge test

@linear
Copy link

linear bot commented Mar 25, 2025

SEQ-725 add tests for AssertionPoster.sol

This contract is used for withdrawals, so it needs to be secure

formal verification of the contract would be amazing as well!

https://github.com/SyndicateProtocol/metabased-rollup/blob/main/metabased-translator/contracts/src/AssertionPoster.sol

@gustavoguimaraes gustavoguimaraes changed the base branch from main to feature/seq-683-wallet-pool March 25, 2025 18:32
Comment on lines 1 to 2
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.28;
Copy link
Contributor

Choose a reason for hiding this comment

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

this interface was deleted. If you merge main, this should get removed

/// @dev Provided data was too large
/// @param dataLength The length of the data that is too large
/// @param maxDataLength The max length the data can be
error DataTooLarge(uint256 dataLength, uint256 maxDataLength);
Copy link
Contributor

Choose a reason for hiding this comment

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

where's this being used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have added to fix compilation issues at first but then after the refactor this may not be needed anymore.

Copy link
Contributor

Choose a reason for hiding this comment

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

let's remove it then

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Uploading Screenshot 2025-03-29 at 11.57.37 AM.png…

Copy link
Contributor

@ericvelazquez ericvelazquez left a comment

Choose a reason for hiding this comment

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

LGTM ✅ ! But lets merge/rebase main first! Thanks for doing this 🙏

Copy link
Contributor

@tsite tsite left a comment

Choose a reason for hiding this comment

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

small comment about the initialization guard, but other than that, lgtm - the tests look great!

devin-ai-integration bot and others added 9 commits March 28, 2025 09:15
…licts

Co-Authored-By: gus@syndicate.io <gus@syndicate.io>
Co-Authored-By: gus@syndicate.io <gus@syndicate.io>
Co-Authored-By: gus@syndicate.io <gus@syndicate.io>
Co-Authored-By: gus@syndicate.io <gus@syndicate.io>
Co-Authored-By: gus@syndicate.io <gus@syndicate.io>
Co-Authored-By: gus@syndicate.io <gus@syndicate.io>
Co-Authored-By: gus@syndicate.io <gus@syndicate.io>
Co-Authored-By: gus@syndicate.io <gus@syndicate.io>
Co-Authored-By: gus@syndicate.io <gus@syndicate.io>
Comment on lines +21 to +22
not(feature = "env-tests"),
ignore = "Counter contract has been removed from arbitrum bindings"
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need this comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed Counter.sol which a template SC from when on boostrap Foundry. I removed it.
I think Devin wanted to explicitly warn about this in the this file which used it before.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am removing it

Copy link
Contributor

@ericvelazquez ericvelazquez left a comment

Choose a reason for hiding this comment

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

Please, fix all the CI issues before merging this. I'm also not sure why changes in full_meta_node.rs and environemtn_tests.rs were needed. Please revert them if not related to this PR.

devin-ai-integration bot and others added 9 commits March 28, 2025 16:17
…n name from initialize to configure

Co-Authored-By: gus@syndicate.io <gus@syndicate.io>
Co-Authored-By: gus@syndicate.io <gus@syndicate.io>
* set tx gas limit to block gas limit

* set tx gas limit to block gas limit
* translator now handles reorgs gracefully

* remove all sleeps on integration_tests and use wait_until! instead

* Update metabased-translator/crates/common/src/tracing.rs

Co-authored-by: Daniil R <daniil@syndicate.io>

* PR comments

* fix reth version

---------

Co-authored-by: Daniil R <daniil@syndicate.io>
Co-Authored-By: gus@syndicate.io <gus@syndicate.io>
Co-Authored-By: gus@syndicate.io <gus@syndicate.io>
jorgemmsilva and others added 12 commits March 31, 2025 12:33
* fix cargo test -- --test-threads=1

* add linear ticket
* TC sequencer initial setup

* Fix clippy

* Fix some comments

* Fix some bugs in TC setup

* Fix tests

* Updates from PR comments: refactor url in config, documentation, comments, and todos

* Add import to fix PR checks
* attempt to make tests less flaky

* extra batch checks
* feat: `shared` lib with shared funcs

* feat: clearer single-level logic

* feat: json-rpc func also

* feat: default logger

* feat: default logger

* feat: default logger

* feat: default logger

* feat: ignore flaky test
* add feature for calldata check modules

* create module for dream chain calldata usecase

* add test for CalldataAlwaysAllwedModule

* rust bindings

* Add test for DreamChainCheckCallerFromCalldataModule

* fix ftm error

* Fix merge conflicts in PR #346 (#351)

* remove unused RESTORE_FROM_SAFE_STATE flag (#338)

* remove _CHAIN_ from env vars (#340)

* docs: Add documentation for forge doc command (#341)

* Add documentation for forge doc command

Co-Authored-By: will@syndicate.io <will@syndicate.io>

* Update forge doc documentation with default behavior

Co-Authored-By: will@syndicate.io <will@syndicate.io>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: will@syndicate.io <will@syndicate.io>

* Remove BLOCK_BUILDER_ and SLOTTER_ prefixes from config values (#339)

* Remove BLOCK_BUILDER_ and SLOTTER_ prefixes from config values

Co-Authored-By: jorge@syndicate.io <jorge@syndicate.io>

* Update variable names to match environment variable names

Co-Authored-By: jorge@syndicate.io <jorge@syndicate.io>

* Update references to renamed variables

Co-Authored-By: jorge@syndicate.io <jorge@syndicate.io>

* Update test cases to use renamed variables

Co-Authored-By: jorge@syndicate.io <jorge@syndicate.io>

* Apply cargo fmt to fix formatting issues

Co-Authored-By: jorge@syndicate.io <jorge@syndicate.io>

* Update variable references in arbitrum_adapter.rs

Co-Authored-By: jorge@syndicate.io <jorge@syndicate.io>

* Update variable references in full_meta_node.rs test file

Co-Authored-By: jorge@syndicate.io <jorge@syndicate.io>

* Update ignore_delayed_messages to arbitrum_ignore_delayed_messages in tests

Co-Authored-By: jorge@syndicate.io <jorge@syndicate.io>

* Update owner_address to rollup_owner_address in integration_tests.rs

Co-Authored-By: jorge@syndicate.io <jorge@syndicate.io>

* Add empty rustfmt config to fix formatting

Co-Authored-By: jorge@syndicate.io <jorge@syndicate.io>

* Update rustfmt config to specify edition

Co-Authored-By: jorge@syndicate.io <jorge@syndicate.io>

* Update rustfmt config with max_width

Co-Authored-By: jorge@syndicate.io <jorge@syndicate.io>

* Update rustfmt config with additional settings

Co-Authored-By: jorge@syndicate.io <jorge@syndicate.io>

* Remove .rustfmt.toml as requested

Co-Authored-By: jorge@syndicate.io <jorge@syndicate.io>

* Run cargo +nightly fmt directly as requested

Co-Authored-By: jorge@syndicate.io <jorge@syndicate.io>

* fix tests

* ROLLUP_TYPE -> TARGET_ROLLUP_TYPE

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: jorge@syndicate.io <jorge@syndicate.io>

* Update pr template to indicate metrics changes (#342)

* feat: maestro skeleton (#344)

* feat: maestro skeleton

* feat: metabased-poster v1 (#337)

* feat: metabased poster scaffolding

* feat: metabased-poster poller

* poller working

* update contract

* submitter working

* update submitter

* update config

* update submitter

* test

* rm rusttool

* update logger

* simple poster

* simple poster

* simplify poster

* simplify poster

* SEQ-694: update test to use assertion poster contract (#343)

Ticket
Related Linear Ticket: SEQ-694
What does this PR do?
Summary:
add a contract for posting assertions that the assertion poster (feat: metabased-poster v1 #337) uses
Key Changes:
remove unused forge-std submodule
reorganize contracts folder layout to separate the arbitrum interfaces from our contracts
Breaking changes?
Yes/No:
No
Metrics changes?
Yes/No:
No
Anything interesting?
All existing metabased rollups can be upgraded to support withdrawals by deploying & initializing the AssertionPoster contract!
How can this PR be tested?
ci tests

* update test to check for config changes (#349)

Ticket
Related Linear Ticket: SEQ-723
What does this PR do?
Summary:
update withdrawal test to check that config changes are handled correctly
Breaking changes?
Yes/No:
No
How can this PR be tested?
manually tested to make sure the test fails if the config values are not updated in the contract
ci tests

* feat: poster docker & deployment scripts (#350)

* feat: poster doker & deployment scripts

* typo

* Fix remaining merge conflicts in arbitrum binding files

Co-Authored-By: gus@syndicate.io <gus@syndicate.io>

* Update Rust contract bindings from feature branch

Co-Authored-By: gus@syndicate.io <gus@syndicate.io>

* Fix missing iassertionposter module in arbitrum bindings

Co-Authored-By: gus@syndicate.io <gus@syndicate.io>

* Add missing module declarations to arbitrum/mod.rs

Co-Authored-By: gus@syndicate.io <gus@syndicate.io>

---------

Co-authored-by: Jorge Silva <jorge@syndicate.io>
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: will@syndicate.io <will@syndicate.io>
Co-authored-by: Kristina Fischer <158780688+squibwarb@users.noreply.github.com>
Co-authored-by: Daniil R <daniil@syndicate.io>
Co-authored-by: Eric Velazquez <ericvelmar95@gmail.com>
Co-authored-by: tsite <stubydent@gmail.com>
Co-authored-by: gus@syndicate.io <gus@syndicate.io>

* rust bindings

* Fix missing forge-std submodule URL for metabased-translator/contracts (#353)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: gus@syndicate.io <gus@syndicate.io>

* update Certora

* fix MetabasedSequencerChain certora spec

* Certora fixez for RequireAllModule

* add spec for RequireAnyModule

* revert certora version to see if it works

* downgrade python version

* rust bindings

* Fix CI pipeline: update Rust contract bindings and fix Certora installation (#354)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: gus@syndicate.io <gus@syndicate.io>

* install setuptools==75.8.2 before certora

* fix spec

* delete superfluous file

---------

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Jorge Silva <jorge@syndicate.io>
Co-authored-by: will@syndicate.io <will@syndicate.io>
Co-authored-by: Kristina Fischer <158780688+squibwarb@users.noreply.github.com>
Co-authored-by: Daniil R <daniil@syndicate.io>
Co-authored-by: Eric Velazquez <ericvelmar95@gmail.com>
Co-authored-by: tsite <stubydent@gmail.com>
Co-authored-by: gus@syndicate.io <gus@syndicate.io>
* implement max_source_chain_latency config

* add slotter_unassigned_settlement_blocks metric

* fixes

* reduce log level

* MAX_SOURCE_CHAIN_LATENCY -> MAX_SOURCE_CHAIN_TIME_GAP

* tests fix

* improve code ergonomics
* add feature for calldata check modules

* create module for dream chain calldata usecase

* add test for CalldataAlwaysAllwedModule

* rust bindings

* Add test for DreamChainCheckCallerFromCalldataModule

* fix ftm error

* Fix merge conflicts in PR #346 (#351)

* remove unused RESTORE_FROM_SAFE_STATE flag (#338)

* remove _CHAIN_ from env vars (#340)

* docs: Add documentation for forge doc command (#341)

* Add documentation for forge doc command

Co-Authored-By: will@syndicate.io <will@syndicate.io>

* Update forge doc documentation with default behavior

Co-Authored-By: will@syndicate.io <will@syndicate.io>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: will@syndicate.io <will@syndicate.io>

* Remove BLOCK_BUILDER_ and SLOTTER_ prefixes from config values (#339)

* Remove BLOCK_BUILDER_ and SLOTTER_ prefixes from config values

Co-Authored-By: jorge@syndicate.io <jorge@syndicate.io>

* Update variable names to match environment variable names

Co-Authored-By: jorge@syndicate.io <jorge@syndicate.io>

* Update references to renamed variables

Co-Authored-By: jorge@syndicate.io <jorge@syndicate.io>

* Update test cases to use renamed variables

Co-Authored-By: jorge@syndicate.io <jorge@syndicate.io>

* Apply cargo fmt to fix formatting issues

Co-Authored-By: jorge@syndicate.io <jorge@syndicate.io>

* Update variable references in arbitrum_adapter.rs

Co-Authored-By: jorge@syndicate.io <jorge@syndicate.io>

* Update variable references in full_meta_node.rs test file

Co-Authored-By: jorge@syndicate.io <jorge@syndicate.io>

* Update ignore_delayed_messages to arbitrum_ignore_delayed_messages in tests

Co-Authored-By: jorge@syndicate.io <jorge@syndicate.io>

* Update owner_address to rollup_owner_address in integration_tests.rs

Co-Authored-By: jorge@syndicate.io <jorge@syndicate.io>

* Add empty rustfmt config to fix formatting

Co-Authored-By: jorge@syndicate.io <jorge@syndicate.io>

* Update rustfmt config to specify edition

Co-Authored-By: jorge@syndicate.io <jorge@syndicate.io>

* Update rustfmt config with max_width

Co-Authored-By: jorge@syndicate.io <jorge@syndicate.io>

* Update rustfmt config with additional settings

Co-Authored-By: jorge@syndicate.io <jorge@syndicate.io>

* Remove .rustfmt.toml as requested

Co-Authored-By: jorge@syndicate.io <jorge@syndicate.io>

* Run cargo +nightly fmt directly as requested

Co-Authored-By: jorge@syndicate.io <jorge@syndicate.io>

* fix tests

* ROLLUP_TYPE -> TARGET_ROLLUP_TYPE

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: jorge@syndicate.io <jorge@syndicate.io>

* Update pr template to indicate metrics changes (#342)

* feat: maestro skeleton (#344)

* feat: maestro skeleton

* feat: metabased-poster v1 (#337)

* feat: metabased poster scaffolding

* feat: metabased-poster poller

* poller working

* update contract

* submitter working

* update submitter

* update config

* update submitter

* test

* rm rusttool

* update logger

* simple poster

* simple poster

* simplify poster

* simplify poster

* SEQ-694: update test to use assertion poster contract (#343)

Ticket
Related Linear Ticket: SEQ-694
What does this PR do?
Summary:
add a contract for posting assertions that the assertion poster (feat: metabased-poster v1 #337) uses
Key Changes:
remove unused forge-std submodule
reorganize contracts folder layout to separate the arbitrum interfaces from our contracts
Breaking changes?
Yes/No:
No
Metrics changes?
Yes/No:
No
Anything interesting?
All existing metabased rollups can be upgraded to support withdrawals by deploying & initializing the AssertionPoster contract!
How can this PR be tested?
ci tests

* update test to check for config changes (#349)

Ticket
Related Linear Ticket: SEQ-723
What does this PR do?
Summary:
update withdrawal test to check that config changes are handled correctly
Breaking changes?
Yes/No:
No
How can this PR be tested?
manually tested to make sure the test fails if the config values are not updated in the contract
ci tests

* feat: poster docker & deployment scripts (#350)

* feat: poster doker & deployment scripts

* typo

* Fix remaining merge conflicts in arbitrum binding files

Co-Authored-By: gus@syndicate.io <gus@syndicate.io>

* Update Rust contract bindings from feature branch

Co-Authored-By: gus@syndicate.io <gus@syndicate.io>

* Fix missing iassertionposter module in arbitrum bindings

Co-Authored-By: gus@syndicate.io <gus@syndicate.io>

* Add missing module declarations to arbitrum/mod.rs

Co-Authored-By: gus@syndicate.io <gus@syndicate.io>

---------

Co-authored-by: Jorge Silva <jorge@syndicate.io>
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: will@syndicate.io <will@syndicate.io>
Co-authored-by: Kristina Fischer <158780688+squibwarb@users.noreply.github.com>
Co-authored-by: Daniil R <daniil@syndicate.io>
Co-authored-by: Eric Velazquez <ericvelmar95@gmail.com>
Co-authored-by: tsite <stubydent@gmail.com>
Co-authored-by: gus@syndicate.io <gus@syndicate.io>

* rust bindings

* Fix missing forge-std submodule URL for metabased-translator/contracts (#353)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: gus@syndicate.io <gus@syndicate.io>

* update Certora

* fix MetabasedSequencerChain certora spec

* Certora fixez for RequireAllModule

* add spec for RequireAnyModule

* revert certora version to see if it works

* downgrade python version

* rust bindings

* Fix CI pipeline: update Rust contract bindings and fix Certora installation (#354)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: gus@syndicate.io <gus@syndicate.io>

* install setuptools==75.8.2 before certora

* fix spec

* delete superfluous file

* create ConfigManager and ChainConfig contracts

* rust bindings

* Update contract bindings for ChainConfig and ConfigManager contracts

Co-Authored-By: gus@syndicate.io <gus@syndicate.io>

* refactor ChainConfig proxy creation. Remove need to add init data

* prefix contract name with "Arb"

* remove TARGET_ROLLUP_TYPE from ArbChainConfig

* rb

* Update contract bindings using make command

Co-Authored-By: gus@syndicate.io <gus@syndicate.io>

* add PR suggestions

* rb

* rb

* Update contract bindings using make command

Co-Authored-By: gus@syndicate.io <gus@syndicate.io>

---------

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Jorge Silva <jorge@syndicate.io>
Co-authored-by: will@syndicate.io <will@syndicate.io>
Co-authored-by: Kristina Fischer <158780688+squibwarb@users.noreply.github.com>
Co-authored-by: Daniil R <daniil@syndicate.io>
Co-authored-by: Eric Velazquez <ericvelmar95@gmail.com>
Co-authored-by: tsite <stubydent@gmail.com>
Co-authored-by: gus@syndicate.io <gus@syndicate.io>
* Update contract to fix tests

* fix binding
* feat: use `shared` lib across repo

* feat: `tc-client` using shared `json_rpc`

* feat: `tc-client` using shared `json_rpc`

* feat: use `shared` txn validation in sequencers

* feat: check txn size in `validation`
- use `Byte-Unit` lib for displaying txn sizes

* feat: check txn size in `validation`
- use `Byte-Unit` lib for displaying txn sizes

* feat: remove dep

* feat: move `test_utils` and `test_tracing` to `/shared`

* feat: move `test_utils` and `test_tracing` to `/shared`

- removes `metabased-translator/crates/test-utils` crate
* feat: maestro Docker image

* feat: maestro Docker image

* feat: maestro Docker image

* feat: maestro Docker image
* feat: maestro Docker image

* feat: maestro Docker image

* feat: maestro Docker image

* feat: maestro Docker image

* feat: maestro Docker image

* feat: add redis_address

* feat: add basic redis connection
Co-Authored-By: gus@syndicate.io <gus@syndicate.io>
@gustavoguimaraes
Copy link
Contributor Author

Close this PR in preference of #395

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.

8 participants