161 Commits

Author SHA1 Message Date
The Dark Jester
0cf2a12abf [Chore] - Tweak readme documentation and audits (#359)
* Tweak readme documentation and audits

* add latest to the Fifth round

* Update contracts/README.md

Co-authored-by: kyzooghost <73516204+kyzooghost@users.noreply.github.com>
Signed-off-by: The Dark Jester <thedarkjester@users.noreply.github.com>

---------

Signed-off-by: The Dark Jester <thedarkjester@users.noreply.github.com>
Co-authored-by: kyzooghost <73516204+kyzooghost@users.noreply.github.com>
2024-11-29 02:07:22 -08:00
The Dark Jester
7476afd033 [Chore] Add setMessageServiceOnTokenBridge task (#347)
* add setMessageServiceOnTokenBridge task

* remove duplicate and correct conditional

* fix missing ! in check
2024-11-28 08:48:24 -08:00
The Dark Jester
466d847e34 [Fix] - Add missing roles and encoding for updateDelay (#345)
* add missing roles and encoding for updateDelay

* remove forge-std and ignore in git
2024-11-27 09:50:52 -08:00
The Dark Jester
cdb74e1496 validate callforwarding proxy works as expected (#338) 2024-11-26 10:16:51 -08:00
The Dark Jester
3fbe660683 remove verification in wrong file (#332) 2024-11-26 03:26:05 -08:00
The Dark Jester
ad1afca98e correct var on tokenbridge deploy (#337) 2024-11-25 06:40:54 -08:00
The Dark Jester
bb7cd3d50d [Chore] Update current reinitialization script for all contracts (#331)
* current reinitialization script for all contracts

* use shared functions consistently

* add forwarding proxy

* add extra logging and use fallbackOperator name

* use env var for fallback operator
2024-11-25 03:40:39 -08:00
The Dark Jester
98291b5c4b [Feat] 191 improve documentation (#316)
* initial changes for the contract readme

* testing guidelines wip

* add contract documentation

* add note on future deprecation

* add memory and CPU requirements for docker

* add audit references to documentation

* use tokenbridge make commands in documentation

* add additional comments to testing guidelines

* define contract style guide and link it

* address PR comments with better documentation

* document tweaks and traffic generation script

* catch error on failure of main()

* add precompute script and readme documentation

* use ethers address generation

---------

Co-authored-by: count-sum <andrei.alexandru@consensys.net>
2024-11-22 09:53:15 -08:00
The Dark Jester
adb097aff4 [Chore] Export contract ABI and use solidity-docgen export (#323)
* export contract ABI and use solidity-docgen export

* add docgen dependency

* lint fixing
2024-11-21 06:49:31 -08:00
The Dark Jester
3b0b65fa3d [FIX] N-04 - Use constants for known fixed values (#303)
* Use constants for known fixed values

* add natspec for the new constants

---------

Signed-off-by: The Dark Jester <thedarkjester@users.noreply.github.com>
2024-11-21 04:57:39 -08:00
The Dark Jester
498e9ba282 make some functions external (#299) 2024-11-21 02:21:53 -08:00
The Dark Jester
7fe6ebbcee check permit allowance before calling permit (#306) 2024-11-21 02:21:28 -08:00
The Dark Jester
619efcae74 [Fix] N-03 - Use 0x20 vs. 32 for memory offset (#300)
* use 0x20 vs. 32 for memory offset

* use 0x20 in message error returning
2024-11-21 02:20:44 -08:00
The Dark Jester
ccb34ee8b9 [Fix] N-02 - add indexes to pause events (#302)
* add indexes to pause events

* use correct spacing
2024-11-21 02:19:43 -08:00
The Dark Jester
46cecd099b use security contact and library description (#301) 2024-11-21 02:19:28 -08:00
The Dark Jester
7a6b981660 [Fix] - L-03 - Add better explicit docstrings (#307)
* add better explicit docstrings

* additional docstrings for completeness

* tweak natspec

* use required vs require in natspec
2024-11-21 02:19:10 -08:00
The Dark Jester
5aa86d6b6a remove extra NB: and add missing return value (#304) 2024-11-21 02:18:50 -08:00
The Dark Jester
4191d2eda2 [Fix] - L-01 - Validate default admin and fallback operator (#305)
* validate default admin and fallback operator

* revert confirmDeployment on empty list

* align natspec
2024-11-21 02:18:28 -08:00
The Dark Jester
fc6b8f9979 [Fix] M-01 Prevent fallback operator calling renounceRole (#298)
* prevent fallback operator calling renounceRole

* do not use virtual in override

* correct grammar in natspec
2024-11-21 02:18:01 -08:00
The Dark Jester
4af87b5fe6 [Chore] - First pass contracts and makefile cleanup (#276)
* first pass contracts and makefile cleanup

* remove unused 4844 test files

* Remove Goerli references

* lint fixing

* lint fixing

* remove more Goerli references

* correct folder paths for L2 service tests

* fix pathing and hardhat version

* reinstate deleted file

* correct file pathing
2024-11-06 02:21:14 -08:00
The Dark Jester
660f849d17 [Fix] G-2,3,4 and 5 - Use return vars on function and optimize reverts (#247)
* Use return vars on function and optimize reverts

* use calldata array lengths directly

* remove cache length on message anchoring

* fix: remove duplicate line

* chore: export new ABIs for LineaRollupV6 and L2MessageServiceV1

---------

Signed-off-by: Victorien Gauch <85494462+VGau@users.noreply.github.com>
Co-authored-by: Victorien Gauch <85494462+VGau@users.noreply.github.com>
Co-authored-by: VGau <victorien.gauch@consensys.net>
2024-10-31 11:31:36 -07:00
Andrei A.
390d6ff860 Feat/122 Add TokenBridge e2e tests (#210)
* fix: add mutex in account manager to avoid nonce issue

* fix: optimize global setup

* Limiting number of concurrent traces API requests for the local stack to avoid occasional OOM-s

* Limiting number of verticles for Traces API node

* Add E2E TokenBridge tests

* fixing test and adding concurency

* fixing test and adding concurency

* fixing test and adding concurency

* fixing test and adding concurency

* fixing nonce management

* deploying l2token for the L2 -> L1 test

* adjusting accounts for L2->L1 test

* adjusting l2TestContractAddress

* use nonce management for L1->L2 test

* adjusting the TestERC20 contract and tests

* rebasing with fix/133-improve-e2e-tests-performance

* fix: update jest config to exit even if there are open handles

* Trying out Besu untuned and raising limit per endpoint to 2 for traces

* Trying out Besu untuned and raising limit per endpoint to 2 for traces and Shomei node

* Using besu untuned for arithmetization as well

* Compile once and parallelise setRemoteTokenBridge

* feat: deploy smart contracts from artifacts + change e2e tests setup

* fix: update pnpm

* fix: remove compile contracts gradle task

* fix: remove compileContracts gradle task

* fix: refactor genesis generator dockerfile + downgrade l1-el-node besu version

* fix: move abi from e2e folder to contract folder + refactor contracts deployments scripts

* feat: add deployment script from artifacts for LineaRollupV6

* update pnpm version in get-started.md

* fix: update console log in deployment scripts

* fix: update besu version + fix deployment scripts

* correct addresses

* fix import

* use abi and bytecode for deployments

* use upgradable beacon for BridgedToken ABI deploys

* use saved abi and bytecode for TestERC20 deploy

* correct deployBridgedTokenAndTokenBridge casing

* optimize token bridge e2e calls

* use explicit message event data

* use precomputed nonces for e2e stack

---------

Co-authored-by: VGau <victorien.gauch@consensys.net>
Co-authored-by: Victorien Gauch <85494462+VGau@users.noreply.github.com>
Co-authored-by: Roman <4833306+Filter94@users.noreply.github.com>
Co-authored-by: thedarkjester <grant.southey@consensys.net>
Co-authored-by: The Dark Jester <thedarkjester@users.noreply.github.com>
2024-10-31 18:03:53 +01:00
The Dark Jester
bf2a760824 Use correct initializer value for L2MessageService (#271) 2024-10-31 17:44:00 +01:00
The Dark Jester
a3a95043ad Use explicit length location pointer (#266) 2024-10-31 17:43:37 +01:00
The Dark Jester
13b37f94c6 [Fix] - I-02 Adjust information findings from report (#256)
* adjust information findings from report

* remove outboxL1L2MessageStatus tests

* remove redundant comment
2024-10-31 17:42:53 +01:00
The Dark Jester
7b99e5ff20 [Fix] M-01 Validate final blob was submitted on finalization (#226)
* Validate final blob was submitted on finalization

* Use new error code in Coordinator

* Use correct name for error
2024-10-31 17:38:52 +01:00
The Dark Jester
31f946ede7 Check parent shnarf exists for calldata submission (#223) 2024-10-31 17:38:31 +01:00
The Dark Jester
4a9b4ec096 [Fix] I-01 Use safe casting for the leaf index verification (#222)
* Use safe casting for the leaf index verification

* use return variable for the cast uint32
2024-10-31 17:38:06 +01:00
The Dark Jester
9a588d80bb G-01 fix removing old initialize function (#212) 2024-10-31 17:37:33 +01:00
Victorien Gauch
36959fb21b Fix(133): Improve e2e tests performance (#234)
* fix: add mutex in account manager to avoid nonce issue

* fix: optimize global setup

* fix: update jest config to exit even if there are open handles

* feat: deploy smart contracts from artifacts + change e2e tests setup

* fix: update pnpm

* fix: remove compile contracts gradle task

* fix: remove compileContracts gradle task

* fix: refactor genesis generator dockerfile + downgrade l1-el-node besu version

* fix: move abi from e2e folder to contract folder + refactor contracts deployments scripts

* feat: add deployment script from artifacts for LineaRollupV6

* update pnpm version in get-started.md

* fix: update console log in deployment scripts

* fix: update besu version + fix deployment scripts

* fix: update submission finalization tests + rename variable
2024-10-30 14:10:24 +01:00
The Dark Jester
5fad7f793c [Fix] Set default admin for token bridge on reinitialization (#211)
* set default admin for token bridge on reinit

* Use more applicable naming for admin
2024-10-20 08:47:24 -07:00
The Dark Jester
017df93188 [Feat] optimize blob submission data (#209)
* smart-contract: small tweak on validation and consistent naming on params

* use currentL2BlockNumber vs. memory

* cache blobFirstBlockNumber

* optimize blob number validation

* cache snarkhash and finalStateRootHash

* remove redundant checks

* remove block numbers from blob submits

* remove extra space

* address naming considerations

* use updated ABI for V6 LineaRollup

* Use NatSpec for ITokenBridge events and errors (#202)

* Use NatSpec for ITokenBridge events and errors

* pass 1 of NatSpec cleanup

* natspec pass 2

* correct wording on NatSpec

* use correct indexed keyword location

---------

Signed-off-by: The Dark Jester <thedarkjester@users.noreply.github.com>
Co-authored-by: Pedro Novais <1478752+jpnovais@users.noreply.github.com>
2024-10-18 11:13:09 -07:00
The Dark Jester
086e0ad077 Use NatSpec for ITokenBridge events and errors (#202)
* Use NatSpec for ITokenBridge events and errors

* pass 1 of NatSpec cleanup

* natspec pass 2

* correct wording on NatSpec

* use correct indexed keyword location
2024-10-18 10:18:42 -07:00
The Dark Jester
b3857464ad Feat/3907 state reconstruction events (#43)
* Remove lastFinalizedShnarf from finalization input
* Emit events state-reconstruction friendly
* Index shnarf on data submitted event

* reinstate public input variable name

* updated V6 ABI

* Coordinator - Allowing endless retries and setting them throughout th… (#89)

* Coordinator - Allowing endless retries and setting them throughout the app

* feat/1731 code coverage in Codecov (#13)

* feat/1731 code coverage in Codecov

* Cancel in progress workflows on new commits (#53)

* Cancel in progress workflows on new commits

* Test - Trigger workflow

* Test - Trigger workflow 2

* Group by only github.ref for branch name

* Add concurrency to more workflows

* Revert "Add concurrency to more workflows"

This reverts commit 86a00aa7b5c8e29d870acdc3d4d25d660b3a59e8.

* Print group

* Remove print steps and amend group

* Test adding concurrency group to testing.yml

* Test concurrency

* Specifying specific groups for child workflows

* Testing concurrency

* Add child groups to build and publish workflows

* Test concurrency

* Remove main workflow concurrency group

* Remove concurrency on pull request merge

* Feat/94 emit version updated event (#98)

* Emit LineaRollupVersionChanged on upgrade

* make padded hex bytes generic

* Use L2MessageService versioned API (#96)

* Stricter path filters for shared jvm-libs module (#52)

* Stricter path filters for shared jvm-libs module

* Update .github/workflows/main.yml

Co-authored-by: Roman Vaseev <4833306+Filter94@users.noreply.github.com>
Signed-off-by: Bradley Bown <bradbown@googlemail.com>

---------

Signed-off-by: Bradley Bown <bradbown@googlemail.com>
Co-authored-by: Roman Vaseev <4833306+Filter94@users.noreply.github.com>

* adding TokenBridge version for completeness (#99)

* Coordinator: DRY refactor test helpers and data for future reuse (#100)

* coordinator: adds slice ByteArrayExtensions.kt

* coordinator: adds testing file system helper

* coordinator: adds testing l1-blob-proof-submission submitter

* coordinator: rename findFile function

* coordinator: move prover responses to common test data for code reuse

* coordinator: fix ByteArray.sliceOf off-by-one bug

* coordinator: remove unnecessary!!

* coordinator: fix gradle deps

* coordinator: fix test

* coordinator: reduce transitive dependencies

* rebuild LineaRollup ABI

* Use finalStateRootHash on DataSubmittedV3

* fix flaky test

* fix regression

* use latest LineaRollup ABI for V6.0

* Add explicit comment for lastFinalizedShnarf

* NatSpec tweak and variable name correction

* Use finalizeBlocks not finalizeBlocksWithoutProof

* Use PAUSE_FINALIZATION_ROLE without WITHPROOF

* remove WithProof from finalize function

* use most up to date ABIs

* use V5 for the current end to end tests

* reinstate format from main

* reset pragma version

* rename file and env var function

---------

Signed-off-by: Bradley Bown <bradbown@googlemail.com>
Co-authored-by: count-sum <andrei.alexandru@consensys.net>
Co-authored-by: Pedro Novais <1478752+jpnovais@users.noreply.github.com>
Co-authored-by: Roman Vaseev <4833306+Filter94@users.noreply.github.com>
Co-authored-by: Bradley Bown <bradbown@googlemail.com>
2024-10-16 05:51:32 -07:00
The Dark Jester
8f67c1ee77 Standardize naming and fix NatSpec (#142)
* standardize naming and fix NatSpec

* Finish sentences correctly.
2024-10-08 00:59:10 -07:00
Victorien Gauch
efbec20b18 Feat: Refactor pause manager structure (#126)
* feat: add PauseType enum

* fix: refactor test utils structure

* fix: add events to PauseManager for pauseType setting

* fix: update linea rollup deployment script

* fix: change utils folder to common

* fix: refactor roles constant and deployment scripts

* fix: add additional check in PermissionManager to prevent empty role assignments

* fix: update initialize functions with an additional param

* fix: update deployment scripts

* fix: update contracts testing

* fix: linting issue

* rename PAUSE_L2_BLOB_SUBMISSION_ROLE to PAUSE_BLOB_SUBMISSION_ROLE
2024-10-04 14:07:01 +02:00
The Dark Jester
405d683059 [Feat] Readd missing tests (#106)
* Use explicit time calculations and add test cover

* remove redundant comments

* use shared expectRevertWithCustomError

* remove .only and expectEvent
2024-09-27 17:55:40 +03:00
The Dark Jester
18e9976f41 use linted format of autogen verifiers (#109) 2024-09-27 14:52:07 +03:00
The Dark Jester
c37c9043da adding TokenBridge version for completeness (#99) 2024-09-25 09:17:55 -07:00
The Dark Jester
53ea890056 Use L2MessageService versioned API (#96) 2024-09-25 08:33:35 -07:00
The Dark Jester
346ce2a128 Feat/94 emit version updated event (#98)
* Emit LineaRollupVersionChanged on upgrade

* make padded hex bytes generic
2024-09-25 08:29:46 -07:00
Andrei A.
61d1724632 feat/1731 code coverage in Codecov (#13)
* feat/1731 code coverage in Codecov
2024-09-25 17:30:15 +03:00
Andrei A.
5256e04ced feat(3921): Gateway Operator (#69)
* feat/3921 Gateway Operator

* use last finalized state for gatewayOperator check

* adjusting natspec

* extend existing struct with gatewayoperator

* use  more explicit NatSpec

---------

Co-authored-by: thedarkjester <grant.southey@consensys.net>
Co-authored-by: Victorien Gauch <85494462+VGau@users.noreply.github.com>
2024-09-24 17:30:17 +02:00
Victorien Gauch
39e0d76239 Chore/3446 cleanup errors and interfaces V2 (#67)
Co-authored-by: count-sum <andrei.alexandru@consensys.net>
Co-authored-by: thedarkjester <grant.southey@consensys.net>
2024-09-24 17:07:39 +02:00
Victorien Gauch
7005fcd94b feat/3823 Remove finalizeBlocksWithoutProof (#66)
Co-authored-by: count-sum <andrei.alexandru@consensys.net>
Co-authored-by: thedarkjester <grant.southey@consensys.net>
2024-09-24 16:25:20 +02:00
Victorien Gauch
961ac9b4d8 feat(3450): complete contracts recommendation (#65)
* Feat/3450 Complete contracts recommendation V2

* fix: linting issue in CoordinatorConfigTest file

---------

Co-authored-by: count-sum <andrei.alexandru@consensys.net>
Co-authored-by: thedarkjester <grant.southey@consensys.net>
2024-09-24 15:53:48 +02:00
Victorien Gauch
65f7000f99 chore(3704): Bump solidity version to 0.8.26 across the repository (#64)
* Bump solidity version to 0.8.26 across the repository

* Regenerated Verifiers

* bump solidity for other merged PRs

---------

Co-authored-by: thedarkjester <grant.southey@consensys.net>
Co-authored-by: The Dark Jester <thedarkjester@users.noreply.github.com>
2024-09-24 11:14:12 +02:00
Victorien Gauch
235b042efd feat(3448): granular roles token bridge (#62)
* Feat/3448 create granular roles for contracts V2
* Correct flaky tests

---------

Co-authored-by: count-sum <andrei.alexandru@consensys.net>
Co-authored-by: thedarkjester <grant.southey@consensys.net>
Co-authored-by: The Dark Jester <thedarkjester@users.noreply.github.com>
2024-09-23 08:59:33 -07:00
Victorien Gauch
7664e20c19 fix: optimize golang caching in smart contracts tests (#84)
* fix: optimize go caching

* fix: trigger contracts tests

* trigger contract CI

* trigger contract CI 2

* trigger contract CI 3

* trigger contract CI 4
2024-09-23 17:13:00 +02:00
Victorien Gauch
fa427235ca feat(3448): create granular roles for contracts (#61)
* Feat/3448 create granular roles for contracts V2

* Initializing minimumFeeInWei

* fixing natspec

---------

Signed-off-by: Victorien Gauch <85494462+VGau@users.noreply.github.com>
Co-authored-by: count-sum <andrei.alexandru@consensys.net>
2024-09-20 18:35:59 +03:00