From 3d9fb9dcc11da3caa8d2b03caa4e177350b7d8f6 Mon Sep 17 00:00:00 2001 From: Ratan Kaliani Date: Sun, 21 Jan 2024 22:00:23 -0800 Subject: [PATCH] README, scripts --- README.md | 43 ++++++++----------- ...itialize.s.sol => ReinitializeDummy.s.sol} | 0 2 files changed, 17 insertions(+), 26 deletions(-) rename contracts/script/{Reinitialize.s.sol => ReinitializeDummy.s.sol} (100%) diff --git a/README.md b/README.md index 13c7ddf7..3a7a5f74 100644 --- a/README.md +++ b/README.md @@ -8,12 +8,12 @@ roots from Avail blocks. ## Deployment The circuits are available on Succinct X [here](https://platform.succinct.xyz/succinctlabs/vectorx). -Vector X is currently deployed for Avail's Goldberg testnet on Holesky [here](https://holesky.etherscan.io/address/0x17156d52c0707cde305661ba45457afc23d851e0#events). +Vector X is currently deployed for Avail's Goldberg testnet on Sepolia [here](https://sepolia.etherscan.io/address/0x5ac10644a873AAcd288775A90d6D0303496A4304#events). -## Integrate +## Run the VectorX Light Client Get the genesis parameters for the `VectorX` contract with a specific Avail block (with no input defaults to block 1). ``` -cargo run --bin genesis -- --block 100 +cargo run --bin genesis -- --block 240000 ``` Update `contracts/.env` following `contracts/.env.example`. @@ -38,25 +38,6 @@ In `/`, run cargo run --bin vectorx ``` -### Reset the Contract -Get the new genesis parameters for the `VectorX` contract with a specific Avail block (with no input defaults to block 1). -``` -cargo run --bin genesis -- --block 100 -``` - -Update `contracts/.env` following `contracts/.env.example`. - -Deploy the `VectorX` contract with genesis parameters. - -In `contracts/`, run -``` -forge install - -source .env - -forge script script/Reinitialize.s.sol --rpc-url $ETHEREUM_RPC_URL --private-key $PRIVATE_KEY --broadcast --verify --verifier etherscan --etherscan-api-key $ETHERSCAN_API_KEY -``` - ## Avail Indexer Avail does not currently store justifications for non-era end blocks on archive nodes, so the following service indexes Avail and stores the ephermal justifications, which are used for `step` @@ -70,13 +51,23 @@ cargo run --bin indexer ## Avail Merkle Proof Service Whenever a new data root commitment is stored on-chain, the merkle proofs need to be made available for end-users to prove the data root's of blocks within those data commitments. This service listens for data root commitment events on-chain and stores the merkle proofs for each data root in the range, which is then exposed via a separate endpoint. -### Run the Merkle Proof Service +### Run the Merkle Proof Indexer Service ``` cargo run --bin events ``` -### Query for a `dataRoot` Proof -Example of querying for the merkle proof data for Goldberg testnet block 156961. +### Query for `dataRoot` Proof Data +Example of querying for the merkle proof data for Goldberg testnet block 248490 from the VectroX contract +deployed on Sepolia (chainId 11155111) at address 0x5ac10644a873AAcd288775A90d6D0303496A4304. ``` -curl https://beaconapi.succinct.xyz/api/integrations/vectorx/156961 +curl https://beaconapi.succinct.xyz/api/integrations/vectorx?chainName=goldberg&contractChainId=11155111&contractAddress=0x5ac10644a873AAcd288775A90d6D0303496A4304&blockNumber=248490 +``` + +## Dummy VectorX Set-Up +If you do not want to generate proofs for the `VectorX` light client, you can use `DummyVectorX` instead with dummy circuits that do not require any intensive proof generation. You can deploy the DummyVectorX contract with the same genesis parameters as the VectorX contract and re-initialize the light client using the following commands. Ensure you are using the dummy function IDs for [`dummy_rotate`](https://alpha.succinct.xyz/avail/vectorx/releases/10) and [`dummy_step`](https://alpha.succinct.xyz/avail/vectorx/releases/9). + +``` +forge script script/DeployDummy.s.sol --rpc-url $ETHEREUM_RPC_URL --private-key $PRIVATE_KEY --broadcast --verify --verifier etherscan --etherscan-api-key $ETHERSCAN_API_KEY + +forge script script/ReinitializeDummy.s.sol --rpc-url $ETHEREUM_RPC_URL --private-key $PRIVATE_KEY --broadcast --verify --verifier etherscan --etherscan-api-key $ETHERSCAN_API_KEY ``` diff --git a/contracts/script/Reinitialize.s.sol b/contracts/script/ReinitializeDummy.s.sol similarity index 100% rename from contracts/script/Reinitialize.s.sol rename to contracts/script/ReinitializeDummy.s.sol