Skip to content
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

fix: CI #56

Closed
wants to merge 226 commits into from
Closed

fix: CI #56

wants to merge 226 commits into from

Conversation

goran-ethernal
Copy link
Contributor

This PR fixes CI actions

vcastellm and others added 30 commits January 19, 2024 10:52
chore: Remove previously introduced scaffold
Add commit linting workflow and PR title check.
According to the quality gate requirements.
* feat: sequence sender and aggregator
joanestebanr and others added 22 commits November 27, 2024 11:31
Support `agglayer:0.2.0-rc.15` the responses of ` CertificateHeader` add a new field: `PreviousLocalExitRoot`
- Fixes error calculating  previousLocalExitRoot on new certificate if a certificate is inError

NOTE: **Database incompatibility with previous version!, require to delete it!**
…202)

* chore: kurtosis-cdk bump (gas token update)

* test

* chore: use new kurtosis-cdk tag

* chore: nit

* chore: clean up
- Avoid to log full certificate because it's too long
- Add logs to `bridgesync` creation
- Reduce log for `l1infotreesync/processor.go:401`  `block 7157878 processed with 0 events` in case of 0 events
---------

Co-authored-by: Stefan Negovanović <[email protected]>
New struct CertificateMetadata to represent the data serialized and deserialized to the Certificate.metadata field.

The new data, FromBlock and CreatedAt is stored in the hash as bigints
* fix: clean proof table on start
* change to run gha

* better wait for processot

* handle context cancel

* handle context cancel

* add mutex to halt

* add mutex to halt

* better wait

* better mutex for halted

* lint

* fix wait

* fix wait

* wip

* wip

* cascade

* wip

* wip

* test passing

* clean

* linter

* fix UTs

* increase coverage

* increase coverage

* increase coverage

* reduce code dup

* reduce code dup

* fix conflicts

* fix conflicts

* fix conflicts

* fix conflicts

* fix conflicts
* feat: limit cert by estimated size (#217)

This set a limit on certificate size that can be set on config file (the size of certificate it's an estimation)
There are a special situation that is going to send a certificate bigger than maximium:
- [ initial_block, end_block ] -> size exceed
- [ initial_block, (end_block -1) ] -> no bridges, so we have to send previous one even that exceed the maximum size

MaxCertSize: max size in bytes of certificate. Default 8Mb. Currently the maximum on Agglayer is 10Mb
```
[AggSender]
MaxCertSize = 8388608
```

* feat: return an error in case agglayer returns certificate with height lower than in local storage (#209)


---------

Co-authored-by: Stefan Negovanović <[email protected]>
The certificate field `metadata`  of `BridgeExit` and `ImportedBridgeExit` instead of containing the full metadata are going to have the hash if length > 0. 
This behevaiour can be configured using a new config param `AggSender.BridgeMetadataAsHash` (by default: `true`)

Other fixes: 
- Missing missing default values for `L1InfoTreeSync.RetryAfterErrorPeriod` and `MaxRetryAttemptsAfterError`
- Improved estimateSize of certificate
- Added e2e bridge messages but disabled because it keep failing (maybe we neeed another PR to fix that)

Co-authored-by: Joan Esteban <[email protected]>
* feat: calculate network id (#212)

* feat: calculate network id

* feat: refactor

* feat: refactor

* feat: separeted function to obtain the rollupID

* feat: obtain RollupID without etherman instance

* Update etherman/etherman.go

Co-authored-by: Stefan Negovanović <[email protected]>

* Update etherman/etherman.go

Co-authored-by: Stefan Negovanović <[email protected]>

* Update etherman/etherman.go

Co-authored-by: Stefan Negovanović <[email protected]>

---------

Co-authored-by: joanestebanr <[email protected]>
Co-authored-by: Stefan Negovanović <[email protected]>

* fix: typo

---------

Co-authored-by: joanestebanr <[email protected]>
Co-authored-by: Stefan Negovanović <[email protected]>
Co-authored-by: Stefan Negovanović <[email protected]>
* fix: use hex instead of byte arrays

* feat: UT

* fix: change estimated certificate size

* fix: UT coverage

* fix: metadata hex in marshal

* fix: underflow fix

* fix: revert underflow fix
…agglayer (#227) (#236)

* chore: update the versions.json

* Remove PPError interface and use the error instead

* Remove non-applicable test cases

* Rename

* test: increase UT coverage

* test: certificate status unmarshal json

* test: TestMerkleProofString

* test: TestGlobalIndexString

* test: move helper functions to a separate file

* test: TestL1InfoTreeLeafString

* test: TestClaimType

* test: parallel execution, renames
* feat: remove sender address from aggoracle

* fix: localize ticker and stop it. Renames

* feat: split GER processing into small functions

* name functions consistently in ChainSender interface
* refactor: encode metadata to be backwards compatible (#216)

* refactor: encode metadata to be backwards compatible

* tests: fix UT

* apply feedback

* test: fix

* fix merge issues

* refactor: metadata cert versioning

* test: fix ut

* fix: typo

* use the CertificateBuildParams

* test: fix ut

* Apply feedback

* fix: lint

* fix: Aggsender high cpu usage (#235)

- fix aggsender is using about 200% of CPU
- add a warning if decrease blockNumber (from L1 provider)

* fix: calculate correct root for `LER` merkle proof and fix `BridgeExit` hash (#237)

* fix: calculate correct root for LER merkle proof, and fix BridgeExit hash

* fix: UTs

* fix: comments

* fix: sqlite3 config improvements

Set some recommended params for sqlite connection.

* fix: lint

---------

Co-authored-by: Victor Castell <[email protected]>
Co-authored-by: Joan Esteban <[email protected]>
Co-authored-by: Victor Castell <[email protected]>
- E2E to test L2 to L2 bridges
- RPC for aggsender: changes components names
- Added `tools` folder that contains `aggsender_find_imported_bridge` required by e2e test
- Add configuration to aggsender: `DryRun` and `EnableRPC`
---------

Co-authored-by: Stefan Negovanović <[email protected]>
Co-authored-by: Rachit Sonthalia <[email protected]>
Co-authored-by: Goran Rojovic <[email protected]>
* integrate new contracts for the aggoracle (wip)

* feat: integrate the GlobalExitRootManager L2 sovereign chain

* fix: backport changes from fep-type1 branch

* chore: remove empty test/e2e.go

* test: update the aggoracle e2e test

* fix: logs

* refactor: rely only on single L1 bridge syncer in the e2e, cleanup logs, handle context cancellation

* refactor: simulated backend so that it correctly initializes bridge contract

* fix: tests

* fix: bridge balance logs

* add extract rpc error data helper function

* extract L1SetupResult and L2SetupResult

* some more cleanups

* fix: update import paths for l2-sovereign-chain contracts and use the Shanghai spec

* refactor: rename waitTxToBeSuccessOrFail to waitForTxResult and update logging messages

* chore: update cdk-contracts-tooling dependency to v0.0.1

* fix: remove duplicated recipes in test/makefile

* test: chaingersender ut

* test: IsGERInjected unit test

* remove removal of mock files

* rename
* added doc

* docs: add the reference to aggoracle doc to the summary

---------

Co-authored-by: Stefan Negovanović <[email protected]>
@goran-ethernal goran-ethernal self-assigned this Dec 24, 2024
Stefan-Ethernal pushed a commit that referenced this pull request Dec 24, 2024
* feat: Added e2e tests to the syncer

* fix: UTs

* fix: comments

* fix: comments 2

* fix: rebase

* fix: lint

* fix: rebase remove old test

* fix: another rebase fix

* fix: stress test

* fix: ut build

* fix: rebuild tree after reorg

* fix: comments

---------

Co-authored-by: Goran Rojovic <[email protected]>
Stefan-Ethernal added a commit that referenced this pull request Dec 24, 2024
* test: Added check for EOA transfer E2E Test (#75)

* tests: PoC bridge testing with bats

* Run bats in e2e

* Remove unused make lines

* tests: wip

* test: better

* Let's see

* test: fix test

* test: use cdk image

* test: bats path

* test: fix

* test: deposit on 1

* test: wait for claim

* test: timeout

* test: timeout

* test: increase timeout

* test: apply feedback

* ci: lint action

* test: do not prepare if already present

* test: Send EOA and deploy contract E2E tests using Bats (#69)

* feat: add helper functions for contract deployment and sending transactions using cast commands

* feat: send EOA transaction test basic

* feat: add CDK_ERIGON_NODE_NAME var

* feat: invoke _common_setup function

* feat: deploy ERC20Mock contract E2E test

* feat: more strict assertions and use run instead of $

* feat: tweaks

* fix: change the way transaction hash is extracted

* fix: change the way transactionHash gets fetched from the output

* fix: cast call helper function and invocation of balanceOf function

* test: use RAW_PRIVATE_KEY env variable for sender private key

* fix: address feedback from @vcastellm

* fix: Linters warning fixes (#74)

* feat: use the latest golangci-lint version and fix config warnings

* fix: linter warnings

* fix: linter warnings (part 2)

* fix: propagate the error from aggregator.Start

* fix: format golangci config file

* fix: suppress gosec overflow issues

* fix: exclude G115 gosec linter rule

* fix: use crypto/rand number generator

* test: apply feedback

* test: lint

* ci: increase lint timeout

* test: balance check for ether transafers

* test: wip

* fix: apply feedback

* fix: cast commands

* test: add edge case

* fix: tests

* fix: resolve conflicts

* fix: tests

* fix: tests

* fix: rpc

* fix: typo

* fix: checkTransactionSuccess

* fix: send eoa transaction test

* refactor: feedback

* refactor: feedback

* fix: simplifications

* fix: even more simplifications

---------

Co-authored-by: Victor Castell <[email protected]>
Co-authored-by: Stefan Negovanović <[email protected]>
Co-authored-by: Stefan Negovanović <[email protected]>

* fix: Aggregator: use sequenceBatch maxTimestamp as TimestampLimit  (#84)

- Update to zkevm-synchronizer-l1 v1.0.1
- Check unexpected/deprecateds fields on config file

* First L1 Info tree in which bridge is included (#70)

* wip

* wip

* WIP

* decoding direct and indeirecr assets and messages works

* connect everything

* fix building contract scripts

* fix building contract scripts

* wip

* WIP

* tree migrated to SQLite

* wip

* wip

* bridgesync working with sqlite

* pass tests

* minor cleaning

* add GetBlockByLER func

* handle err not found

* merge develop

* use memory for sqlite on the tests

* increase timestamp to pass UT

* review

* finished implementation

* replace l1bridge2infosync for rpc logic

* ut wip

* unit tests for new rpc funcs

* add UTs for new methods in the l1infotreesync processor

* fix UTs

* pass linter

* add PR requests

* add missing processor calls

* fixx linter

* rephrase binnary search formula

* rephrase binnary search formula

* feat: add missing methods needed to generate PP certificate (#82)

* wip

* wip

* WIP

* decoding direct and indeirecr assets and messages works

* connect everything

* fix building contract scripts

* fix building contract scripts

* wip

* WIP

* tree migrated to SQLite

* wip

* wip

* bridgesync working with sqlite

* pass tests

* minor cleaning

* add GetBlockByLER func

* handle err not found

* merge develop

* use memory for sqlite on the tests

* increase timestamp to pass UT

* review

* finished implementation

* replace l1bridge2infosync for rpc logic

* ut wip

* unit tests for new rpc funcs

* add UTs for new methods in the l1infotreesync processor

* fix UTs

* pass linter

* add PR requests

* add missing processor calls

* fixx linter

* feat: add missing methods needed to generate PP certificate

* fix linter

* feat: seq sender sanity check l1infotree (#86)

* test: Custom native gas token transfer E2E test (#79)

* test: Add smart contract e2e tests (#85)

* feat: sc tests

* fix: tests

* fix: test

* feat: more tests

* fix: tests

* fix: tests

* fix: seprate keys for contracts deployement

* fix: rename sender private key env var

* fix: failing e2e tests

* chore: rename functions ( bash style)

* fix: access lists e2e tests

* refactor: apply feedback

* fix: polycli version

* fix: polycli workflow

* refactor: apply feedback

---------

Co-authored-by: Stefan Negovanović <[email protected]>

* feat: Add e2e reorg tests to syncers  (#56)

* feat: Added e2e tests to the syncer

* fix: UTs

* fix: comments

* fix: comments 2

* fix: rebase

* fix: lint

* fix: rebase remove old test

* fix: another rebase fix

* fix: stress test

* fix: ut build

* fix: rebuild tree after reorg

* fix: comments

---------

Co-authored-by: Goran Rojovic <[email protected]>

* ci: update polycli version (#89)

* feat: update relase regex (#93)

* Revert "feat: update relase regex (#93)" (#94)

This reverts commit e9a1ec0.

* ci: pin kurtosis-cdk version in tests (#92)

* add more tests claimtest (#96)

* feat: Use InitL1InfoRootMap (#87)

- Fix l1infotreesync. Error UNIQUE constraint failed: rollup_exit_root.hash on VerifyBatches Event
- l1infotreesync: Add verification for contract address. The problem is that if you set bad address cdk run normally but you don't get any information about L1InfoTree.
- l1infotreesync: Add support to `InitL1InfoRootMap`
- Allow to use `InitL1InfoRootMap` if there are no leaves on L1InfoTree

Internal:
- Fix local config file generation for debug on vscode (`./scripts/local_config`)
    - Add support to `contractVersions`
    - Remove param `-custom-network-file` that is no longer used
- Refactor `l1infotreesync/processor.go` in multiples files
- Change some tree functions to use a `tx db.Querier` instead of `ctx context.Context`: context was not used to do DB query was using `db` directly. In some test I need to query over current tx

* feat: New `zkevm-ethtx-manager` version (#98)

* fix: update zkevm-ethtx-manager version

* fix: UTs

* feat: remove data stream from sequence sender (#63)

* feat: implement batch interface

* feat: update sync lib

* feat: enable test

* feat: update config files

* feat: fix test

* feat: fix test

* feat: batch string method

* feat: update kurtosis commit

* fix: comments

* fix: comments

* fix: linter

* fix: vars

* fix: error return

* fix: regex

* fix: hex to to bytes

* feat: update kurtosis template

* feat: use config-file on CDK for kurtosis e2e tests (#99)

- The e2e test for CDK use a local configuration template instead of the one on kurtosis branch: to allow to develop changes on config file is more easy if we are able to use the config file on CDK repo. After that we can update config file and cdk image on kurtosis repo
- The local configuration for run on vscode use the same template (`test/config/kurtosis-cdk-node-config.toml.template`)  as the e2e test
- Fix error on CI `test-e2e.yml` with the duplicated `ref` key

* feat: update zkevm-synchronizer-l1 to v1.0.2 (#102)

-  update zkevm-synchronizer-l1 from [v1.0.1](https://github.com/0xPolygonHermez/zkevm-synchronizer-l1/releases/tag/v1.0.1) to [v1.0.2](https://github.com/0xPolygonHermez/zkevm-synchronizer-l1/releases/tag/v1.0.2):
       - fix: [#119](0xPolygonHermez/zkevm-synchronizer-l1#119), fails if there are multiple sequencedBatch in same bock because a SQL have wrong order by
       - feat: add check to DB configuration
       - fix: downgrade migrations sql lite, remove scheme prefix from tables names

* refactor: simplify running Kurtosis combinations (#101)

Using a set of pre-defined combinations of components,
we're going to test the versions we're interested in.

* feat: Initial for packagers (#90)

* Initial for packagers
* Adding BUILD_SCRIPT_DISABLED=1 to debian packagers

* feat: Integrate ethtxmanager with sql lite storage (#97)

* chore: fix comments

* feat: integrate the v0.2.0 eth tx manager spec

* fix: rename DBPath to StoragePath in the ethtxmanager config

* chore: rename according to golang guidelines

* chore: deprecate the PersistenceFilename config param

* test: unit test for obsoleted PersistenceFIlename configuration parameter

* feat: adapt kurtosis cdk and fix errors (#104)

- Some request of ports return the protocol and another no so the code have been updated to support port with protocol or without (`http://127.0.0.1:8023` or `127.0.0.1:8023`)
- Also, to support changing end-point names have include a list of 'end-points' to get the URL / port
- There was a hardcoded path in config file that have been changed by vars and left the absolute path used by kurtosis as deault value

* feat: Sequence sender unit tests (#103)

* feat: Proof Cleaning (#105)

* feat: proof cleaning

* feat: improve log

* feat: Upgraded cdk-rpc dep (#108)

* fix: cdk-523, update zkevm-synchronizer-l1 to v1.0.3 (#109)

* ci: bump kurtosis tag and cdk-erigon (#106)

* ci: bump cdk-erigon

Also remove testing fork9-rollup

* fix: check ssender config (#110)

* fix: check ssender config

* feat: add default value

* fix: if sanity check of l1infotreeUpdateV2 fails, means an error and need to stop syncing (#113)

* feat: Run cdk-erigon with cdk config files transparently for the user (#88)

* feat: dynamically generate erigon config

Render the config files in tmp and run erigon passing the path of the
config file.

* feat: add node components param
* docs: update readme
* refactor: remove admin address
* fix: adapt dockerfile
* refactor: tune makefile

* ci: fix release tags (#114)

* ci: fix release tags

* ci: fix regex for release

* refactor: accept empty config file (#118)

This is necessary because we're not going to check for any values at this point.

* refactor: set default on all config values (#119)

* test: add test for aggregator  (#100)

* test: mockery setuo

* feat: make interface exported

* test: add aggregator e2e test

* test: wip

* test: wip

* fix: tests

* fix: tests

* test: wip

* test: refactored

* fix: Makefile

* fix: lint

* fix: test

* fix: race condition

* fix: apply feedback

* fix: apply feedback

* fix: apply feedback and remove cyclic dependency

* fix: remove comments

---------

Co-authored-by: Toni Ramírez <[email protected]>

* feat: add versions command (#120)

* refactor: not all commands need the same params
* feat: versions command

* feat: Add support for all the contracts on `test/helpers` so it's easy to build E2E tests (#115)

* fix: shorthand and add descriptions (#123)

* fix: shorthand and add descriptions
* ci: bump cdk-erigon

* feat: L1 Info Tree sync testing (#124)

* feat: warning on agglayer rate limit (#122)

* feat: retry on agglayer rate limit exceeded

* chore: bump erigon (#127)

* feat: currentStreamBatchRaw sanity check (#131) (#132)

* fix: Fixing L1 info tree sync tests (#130) (#134)

* fix: Fix l1infotreesync tests

Co-authored-by: rbpol <[email protected]>

* ci: bump kurtosis version (#128)

* ci: bump kurtosis version

Also bumb necessary versions in combinations.

* test: compute gas-price
* test: remove txspammer

---------

Co-authored-by: Rachit Sonthalia <[email protected]>
Co-authored-by: Stefan Negovanović <[email protected]>
Co-authored-by: Stefan Negovanović <[email protected]>
Co-authored-by: Joan Esteban <[email protected]>
Co-authored-by: Arnau Bennassar <[email protected]>
Co-authored-by: rbpol <[email protected]>
Co-authored-by: Goran Rojovic <[email protected]>
Co-authored-by: Toni Ramírez <[email protected]>
Co-authored-by: laisolizq <[email protected]>
Co-authored-by: Goran Rojovic <[email protected]>
Co-authored-by: Daniel Jones <[email protected]>
Co-authored-by: Toni Ramírez <[email protected]>
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.