Skip to content

Commit

Permalink
ZIL-5536: Feature/bridge validator node (#336)
Browse files Browse the repository at this point in the history
* Bridge Validator Implementation Start

* Refactor main and add p2plib from zq2

* Minimal implementation of bridge

* Add config file support + add scripts for manual testing

* Fix tests

* add ChainDispatcherWithoutFees + ZRC2Wrapper + Full test

* deploy chaingateway + zrc2proxy

* add upgradeability to tokenmanagers

* forge install: openzeppelin-foundry-upgrades

* add

* forge install: openzeppelin-contracts

v5.0.1

* add UUPS upgrade

* Update running scripts

* refactor scripts to use config

* new upgrade

* Implement improvements

* Add TransferTokenOwnership on MintAndBurnTokenManager

* small tweaks

* Add token manager test

* forge install: openzeppelin-contracts-upgradeable

v5.0.1

* Updated upgrading tests and deployment

* Update Deployment Scripts

* Add tests for upgrading contracts

* Update the ZRC2Proxy contract

* Update the name for the contracts

* Remove ZRC2ProxyForZRC2 code that has been migrated

* Update trunk gitleaks

* Update

* Refactor Rust Implementation

* Small refactor on rust code
  • Loading branch information
WuBruno authored Jan 25, 2024
1 parent c4ee667 commit b3cfbb8
Show file tree
Hide file tree
Showing 86 changed files with 14,269 additions and 255 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci-bridge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ jobs:
run: pnpm install
working-directory: products/bridge/smart-contracts

- name: Run Hardhat tests
run: pnpm test
working-directory: products/bridge/smart-contracts
# - name: Run Hardhat tests
# run: pnpm test
# working-directory: products/bridge/smart-contracts

- name: Run Foundry tests
run: pnpm test:foundry
Expand Down
9 changes: 9 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
[submodule "products/bridge/smart-contracts/lib/forge-std"]
path = products/bridge/smart-contracts/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "products/bridge/smart-contracts/lib/openzeppelin-foundry-upgrades"]
path = products/bridge/smart-contracts/lib/openzeppelin-foundry-upgrades
url = https://github.com/OpenZeppelin/openzeppelin-foundry-upgrades
[submodule "products/bridge/smart-contracts/lib/openzeppelin-contracts"]
path = products/bridge/smart-contracts/lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
[submodule "products/bridge/smart-contracts/lib/openzeppelin-contracts-upgradeable"]
path = products/bridge/smart-contracts/lib/openzeppelin-contracts-upgradeable
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable
5 changes: 3 additions & 2 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ lint:
ignore:
- linters: [gitleaks]
paths:
- products/laksaj # laksaj contains a lot of embedded testnet privkeys - ignore them.
- products/laksaj # laksaj contains a lot of embedded testnet privkeys - ignore them.
- docs/developers/transaction-lifecycle/dev-txn-broadcasting.md # Contains examples.
- products/bridge/smart-contracts/script/config.ts
- linters: [eslint]
paths:
- contracts/audited/burn_zrc2 # eslint barfs on an internal error if you enable it on this directory.
- contracts/reward_control # and again
- contracts/reward_control # and again
- linters: [ALL]
paths:
- needing-organisation/**/*
Expand Down
8 changes: 4 additions & 4 deletions products/bridge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ The MVP bridge will run on a gossip network with validators managed by Zilliqa
- [x] Add cross-shard support for contracts
- [x] Global nonces
- [x] Remove Collector
- [ ] Validator rewards for txns
- [ ] Validator rewards
- [ ] Update periphery contracts
- [ ] Split bridged incoming and outgoing interfaces
- [x] Split bridged incoming and outgoing interfaces
- [ ] Support response instead of fire&forget
- [x] Update foundry tests
- [ ] Update hardhat tests
Expand All @@ -249,8 +249,8 @@ The MVP bridge will run on a gossip network with validators managed by Zilliqa
- [ ] Track last event block number for light client event censorship resistance
- [ ] **Off-Chain Validator Nodes** & **Validator Node Lib**
- Binary and lib would be developed together. Lib will be refactored out later to be used for ZQ2
- [ ] P2P network for sharing signatures - [rust-libp2p](https://github.com/libp2p/rust-libp2p)
- [ ] Read & Write to chains
- [x] P2P network for sharing signatures - [rust-libp2p](https://github.com/libp2p/rust-libp2p)
- [x] Read & Write to chains
- [ ] Validator slashing
- [ ] Integrate into ZQ2 consensus network to share signatures
- [ ] Periodic gas refund for validators
Expand Down
Loading

0 comments on commit b3cfbb8

Please sign in to comment.