Skip to content

Commit

Permalink
Fix l1 bridge upgrade (#172)
Browse files Browse the repository at this point in the history
* commiting a working version of makefile

* new files

* committing update eth contract code

* artifacts

* upgrade ETH bridge script

* updated snos and add cairo lang as gitmodule

* working w/ submodules

* purge scrip

* ignore all for submodules

* add verifier to env

* rename purge script

* fixes

* Fix : kzg stateupdate and y_0 point eval  (#166)

* feat : refactored blob calc logic

* feat : updated y_0 point logic

* fix : tests

* fix : tests

* fix : gh runners

* fix : gh runners

* fix : linter fix and env.tests fix

* makefile commit hash changes

* fix : test

* feat : updated ethereum settlement client funcs

* feat : refactor changes

* snos build fix

* chore : refactor test cases

* chore : refactor

* chore : refactor

* fix : lint

* fix : db functions

* Makefile fixes (#168)

* fixes

* fix pid kill

* fix verifier add

* Makefile fixes (#170)

* fixes

* fix pid kill

* fix verifier add

* review fixes

* fix clippy

* e2e test fix

* upgrade l1 bridge

* makefile changes

* changelog

* prettier

* readme for artifacts

* commit file

* change sleep time

* fix readme

* add points in readme

* prettier

---------

Co-authored-by: Arun Jangra <arunjangra1001@gmail.com>
  • Loading branch information
apoorvsadana and ocdbytes authored Nov 4, 2024
1 parent 85aacf6 commit ce5219d
Show file tree
Hide file tree
Showing 16 changed files with 3,196 additions and 18 deletions.
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
target/
dashboards
cairo-lang/
madara/
madara-bootstrapper/
pathfinder/
orchestrator_venv/
build/
node_modules/
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

## Added

- upgrade ETH L1 bridge for withdrawals to work
- added makefile and submodules
- Endpoints for triggering processing and verification jobs
- Add multiple queues for processing and verification based on job type
Expand Down
12 changes: 5 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ MADARA_DATA_PATH := $(shell pwd)/build/madara
PATHFINDER_COMMIT := 138140e5fd967ede92806fd62de47c2e6b65712a
PATHFINDER_DATA_PATH := $(shell pwd)/build/pathfinder
PATHFINDER_PATH := $(shell pwd)/pathfinder
ETHEREUM_WSS_RPC_URL := wss://eth-sepolia.g.alchemy.com/v2/<api_key>
ETHEREUM_WSS_RPC_URL := wss://eth-sepolia.g.alchemy.com/v2/${ETHEREUM_API_KEY}

# Environment file
ENV_FILE := $(shell pwd)/.makefile.json
Expand Down Expand Up @@ -67,6 +67,9 @@ setup:
@echo "Starting ETH Bridge setup..."
@make eth-bridge

# we need to sleep for a little as it's possible the block hasn't been sealed yet
@sleep 10

@echo "Terminating previous Madara instance..."
$(call kill_pid,madara)

Expand Down Expand Up @@ -96,10 +99,6 @@ setup:
fi
@echo "Starknet OS built"

@echo "Starting orchestrator"
@make orchestrator
@echo "Setup completed."

@make cleanup


Expand Down Expand Up @@ -133,7 +132,7 @@ core-contract:
cd $(BOOTSTRAPPER_PATH) && \
rm -f $(BOOTSTRAP_OUTPUT_PATH) && \
git checkout $(BOOTSTRAPPER_COMMIT) && \
RUST_LOG=debug cargo run --release -- --mode core --operator-address $(OPERATOR_ADDRESS) --output-file $(BOOTSTRAP_OUTPUT_PATH) --verifier-address $(VERIFIER_ADDRESS) && \
RUST_LOG=debug cargo run --release -- --mode core --operator-address $(OPERATOR_ADDRESS) --output-file $(BOOTSTRAP_OUTPUT_PATH) --verifier-address $(VERIFIER_ADDRESS) --config-hash-version "StarknetOsConfig2" && \
cat $(BOOTSTRAP_OUTPUT_PATH) && \
$(call save_json,"CORE_CONTRACT_ADDRESS",$$(jq -r .starknet_contract_address $(BOOTSTRAP_OUTPUT_PATH))) && \
$(call save_json,"CORE_CONTRACT_IMPLEMENTATION_ADDRESS",$$(jq -r .starknet_contract_implementation_address $(BOOTSTRAP_OUTPUT_PATH)))
Expand All @@ -149,7 +148,6 @@ eth-bridge:
git checkout $(BOOTSTRAPPER_COMMIT) && \
export CORE_CONTRACT_ADDRESS=$$(jq -r '.CORE_CONTRACT_ADDRESS' $(ENV_FILE)) && \
export CORE_CONTRACT_IMPLEMENTATION_ADDRESS=$$(jq -r '.CORE_CONTRACT_IMPLEMENTATION_ADDRESS' $(ENV_FILE)) && \
echo "TODO: set core contract address" && \
RUST_LOG=debug cargo run --release -- --mode eth-bridge --core-contract-address $$CORE_CONTRACT_ADDRESS --core-contract-implementation-address $$CORE_CONTRACT_IMPLEMENTATION_ADDRESS --output-file $(BOOTSTRAP_OUTPUT_PATH) && \
$(call save_json,"L1_BRIDGE_ADDRESS","$$(jq -r .eth_bridge_setup_outputs.l1_bridge_address $(BOOTSTRAP_OUTPUT_PATH))") && \
$(call save_json,"L2_ETH_TOKEN_ADDRESS","$$(jq -r .eth_bridge_setup_outputs.l2_eth_proxy_address $(BOOTSTRAP_OUTPUT_PATH))") && \
Expand Down
17 changes: 17 additions & 0 deletions scripts/artifacts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Link to artifact sources

Ethereum

1. /eth/eic_eth_bridge.json - <https://github.com/starknet-io/starkgate-contracts/blob/5a10fd263d29cd032b7229691d043520edae0737/src/solidity/StarkgateUpgradeAssistExternalInitializer.sol>
2. /eth/new_eth_bridge.json - <https://github.com/starknet-io/starkgate-contracts/blob/5a10fd263d29cd032b7229691d043520edae0737/src/solidity/StarknetEthBridge.sol>

Starknet

1. /starknet/bridge_proxy_legacy.json - <https://github.com/karnotxyz/kanot-bridge-deployment/blob/98c8cf5e80ebbb32f0a56c421055adaefae0b871/src/contracts/proxy_legacy.json>
2. /starknet/eic_eth_bridge.sierra.json - from SN Sepolia
3. /starknet/eic_eth_token.sierra.json - from SN Sepolia
4. /starknet/new_eth_bridge.sierra.json - from SN Sepolia
5. /starknet/new_eth_token.sierra.json - from SN Sepolia

TODO: move this code to the bootstrapper + build contracts from source
in the repo itself
326 changes: 326 additions & 0 deletions scripts/artifacts/eth/eic_eth_bridge.json

Large diffs are not rendered by default.

Loading

0 comments on commit ce5219d

Please sign in to comment.