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

Tidy up example #352

Open
wants to merge 52 commits into
base: main
Choose a base branch
from
Open

Tidy up example #352

wants to merge 52 commits into from

Conversation

xqft
Copy link
Member

@xqft xqft commented Sep 27, 2024

  • Adds verification key check for smart contract
  • Leave the zkApp contract address fixed
  • Some debug msgs
  • SudokuValidity address now env var

gabrielbosio and others added 30 commits July 16, 2024 17:02
* Remove modules that won't be used in the Aligned version

* Fix Markdown lint issues

* Forward GraphQL port in CI

* Remove domain name usage

* Remove tunneling and comment Merkle path job

* Uncomment Merkle path job and comment nextest step

* Try port forwarding to access GraphQL

* Revert "Try port forwarding to access GraphQL"

This reverts commit 79084b9.
* Remove modules that won't be used in the Aligned version

* Fix Markdown lint issues

* Forward GraphQL port in CI

* Remove domain name usage

* Remove tunneling and comment Merkle path job

* Uncomment Merkle path job and comment nextest step

* Try port forwarding to access GraphQL

* Revert "Try port forwarding to access GraphQL"

This reverts commit 79084b9.

* Fetch state hash and proof and parse them

* Simplify input parsing

* Revert "Simplify input parsing"

This reverts commit 91a1621.

* Separate queries for hash and proof

* Integrate with Aligned

* Add test

* Remove unwraps

* Add usage section

* Fetch last block from Mina (#291)

* Fetch last block and simplify polling

* Add public input generation

* Add integration test

* Read protocol state proof

* Remove unnecessary ignored file

* Use mina-builder as GraphQL server

* Add Polling service job

* Make test generate files in same dir

* Fix clippy issue
* Send hardocoded (for now) tip data

* Adapt to new state size
* Add state size to public input

* Cast state len to u32
* Renamed polling service to core

* Reorg core

* WIP aligned_polling_service

* Implemented submit function to aligned service

* Added tokio and called submit proof function

* Added dotenv and default values for some variables

* Added logging

* Fixed batcher address

* Better logging

* Update logs

* Update Makefile

* Update README

* Fix CI
* chore: forge init

* forge install: forge-std

v1.9.1

* Contract baseline

* Rename files and contract

* forge install: aligned_layer

mina

* Fix remappings

* Fix versions and remappings

* First version of updateLastVerifiedState function
* Create smart contract utility

* Add contract ABI

* WIP call contract

* Finish function to update smart contract

* WIP Deploy contract

* Finished bridge contract deployment

* WIP Hash public inputs

* Finished smart contract utility

* Remove unused env vars

* Fix mina bridge script

* Update readme

* Clarify Makefile comment

* Fix module doc

* Move smart contract update comment

* Update README.md

---------

Co-authored-by: Gabriel Bosio <[email protected]>
* Create smart contract utility

* Add contract ABI

* WIP call contract

* Finish function to update smart contract

* WIP Deploy contract

* Finished bridge contract deployment

* WIP Hash public inputs

* Finished smart contract utility

* Remove unused env vars

* Fix mina bridge script

* Update readme

* Clarify Makefile comment

* Fix module doc

* Move smart contract update comment

* Refactor constants into their own file

* Better logging

* Change variable name

* Change log

* Refactor environment variables

* Refactor env.rs and constants.rs into utils mod

* Refactor wallet setup

* Add missing env var

* Default env vars as constants

* Fix test

* Remove git diff marker

* Remove git diff marker

* Update README.md

Co-authored-by: Gabriel Bosio <[email protected]>

* Refactor closure

---------

Co-authored-by: Gabriel Bosio <[email protected]>
* Started README specification section

* Architecture updated

* Architecture links updated

* update Mina Polling Service Architecture

* Update specification

* README fixes

* Fix warning

* Fix usage section

* Update consensus checks

* Fix header

* Fix about

* Fix about

* Fix links

* Fix links

* Update README.md

---------

Co-authored-by: Eduardo Veralli <[email protected]>
* Remove modules that won't be used in the Aligned version

* Fix Markdown lint issues

* Forward GraphQL port in CI

* Remove domain name usage

* Remove tunneling and comment Merkle path job

* Uncomment Merkle path job and comment nextest step

* Try port forwarding to access GraphQL

* Revert "Try port forwarding to access GraphQL"

This reverts commit 79084b9.

* Fetch state hash and proof and parse them

* Simplify input parsing

* Revert "Simplify input parsing"

This reverts commit 91a1621.

* Separate queries for hash and proof

* Integrate with Aligned

* Add test

* Remove unwraps

* Add usage section

* Add initial SP1 project for account inclusion

* Simplify and add make cmd

* Match SP1 version with Aligned one

* Query and parse Merkle root

* Fix parser lockfile

* WIP Merkle path verification

* Query merkle root

* Verify merkle

* Moved query merkle root fn to test module

* Move merkle_path.rs to lib.rs

* Remove SP1 project, move tests crate out

* Small fixes

* Added query merkle root

* WIP get tip state hash

* Finished account inclusion

* Update contract names

* Update README.md

* Apply suggestions from code review

Co-authored-by: Gabriel Bosio <[email protected]>

* Add newline to .gitignore

---------

Co-authored-by: Estéfano Bargas <[email protected]>
* Remove modules that won't be used in the Aligned version

* Fix Markdown lint issues

* Forward GraphQL port in CI

* Remove domain name usage

* Remove tunneling and comment Merkle path job

* Uncomment Merkle path job and comment nextest step

* Try port forwarding to access GraphQL

* Revert "Try port forwarding to access GraphQL"

This reverts commit 79084b9.

* Fetch state hash and proof and parse them

* Simplify input parsing

* Revert "Simplify input parsing"

This reverts commit 91a1621.

* Separate queries for hash and proof

* Integrate with Aligned

* Add test

* Remove unwraps

* Add usage section

* Add initial SP1 project for account inclusion

* Simplify and add make cmd

* Match SP1 version with Aligned one

* Query and parse Merkle root

* Fix parser lockfile

* WIP

* WIP Merkle path verification

* Query merkle root

* Verify merkle

* Moved query merkle root fn to test module

* Move merkle_path.rs to lib.rs

* Remove SP1 project, move tests crate out

* Small fixes

* Added query merkle root

* WIP get tip state hash

* Finished account inclusion

* Update contract names

* WIP use graphql_client

* Fix and add debug comments

* Remove conflict

---------

Co-authored-by: gabrielbosio <[email protected]>
Co-authored-by: Estéfano Bargas <[email protected]>
* Remove modules that won't be used in the Aligned version

* Fix Markdown lint issues

* Forward GraphQL port in CI

* Remove domain name usage

* Remove tunneling and comment Merkle path job

* Uncomment Merkle path job and comment nextest step

* Try port forwarding to access GraphQL

* Revert "Try port forwarding to access GraphQL"

This reverts commit 79084b9.

* Fetch state hash and proof and parse them

* Simplify input parsing

* Revert "Simplify input parsing"

This reverts commit 91a1621.

* Separate queries for hash and proof

* Integrate with Aligned

* Add test

* Remove unwraps

* Add usage section

* Add initial SP1 project for account inclusion

* Simplify and add make cmd

* Match SP1 version with Aligned one

* Query and parse Merkle root

* Fix parser lockfile

* WIP

* WIP Merkle path verification

* Query merkle root

* Verify merkle

* Moved query merkle root fn to test module

* Move merkle_path.rs to lib.rs

* Remove SP1 project, move tests crate out

* Small fixes

* Added query merkle root

* WIP get tip state hash

* Finished account inclusion

* Update contract names

* WIP use graphql_client

* Fix and add debug comments

* Use tip state from bridge contract

* Fix bad candidate hash

* Fix test and remove unused functions

* Add tip hash check in contract

* Serialize hashes first in pub inputs

* Add option to save proof files

* Use root state as initial tip for bridge (#308)

* Add root state hash argument to contract and deploy it using ethers

* Add contract_deployer crate

* Added root query

* Deploy contract with root

* Deploy contract with alloy

* Fix aligned contract address

* Add abi gen to deploy contract make rule

* Fix clippy

* Add error message to test

* Remove test (for now we cant execute it until we have an integration test)

* Fix account inclusion test

* Fix account inclusion test

* Update .gitignore

* Ignore test

---------

Co-authored-by: gabrielbosio <[email protected]>
* Update README.md

* readme update

* Update readme file

* Update readme file Transition frontier

* Small fixes

* Update README.md

* Format

---------

Co-authored-by: Eduardo Veralli <[email protected]>
Co-authored-by: gabrielbosio <[email protected]>
* Add Holesky vars

* Update Mina contract

* Make it work for Holesky

* Fix clippy issues

* Log verification time

* Add Holesky constants and update dependencies

* Update Holesky contract

* Add newline in gitignore

* Move proof generator addr to Aligned group

* Revert Aligned SM address in Forge script

This script will be removed in another PR because it was replaced
with the contract_deployer.

* Integrate private key and keystore with contract deployment

* Point aligned branch back to mina

* Update Mina Holesky contract
…service's one (#317)

* Added merkle query

* Rename query_and_serialize

* WIP merkle query

* Fix test

* WIP Account query

* Finished account query

* Fixed TokenId deserialization

* Remove account query

* Fix clippy

* Delete account_inclusion directory

* Update ci.yaml
* Delete nonce file on submit error

* Update Holesky contract
* Added merkle query

* Rename query_and_serialize

* WIP merkle query

* Fix test

* WIP Account query

* Finished account query

* Fixed TokenId deserialization

* Remove account query

* Fix clippy

* Removed account_inclusion crate

* Take into account mina account proofs

* Add CLI commands

* Implement submission code for account proof

* Add ledger hash to state verifier

* Add accountIdHash and account verification feature for smart contract

* Add eth call for update account

* Fix clippy

* Update makefile rules

* Update specification

* Added doc to smart contract

* Fix clippy

* Update README.md

* Update Makefile

* Fix aligned sdk git dependency

* Update cargo.lock
* Added merkle query

* Rename query_and_serialize

* WIP merkle query

* Fix test

* WIP Account query

* Finished account query

* Fixed TokenId deserialization

* Remove account query

* Fix clippy

* Removed account_inclusion crate

* Take into account mina account proofs

* Add CLI commands

* Implement submission code for account proof

* Add ledger hash to state verifier

* Add accountIdHash and account verification feature for smart contract

* Add eth call for update account

* Fix clippy

* Update makefile rules

* Update specification

* Added doc to smart contract

* Fix clippy

* Update README.md

* Query candidate chain, use bincode

* Update Makefile

* Fix aligned sdk git dependency

* Update cargo.lock

* Define new state proof, serialize with bincode

* Change proof field types

* Refactor proof definition

* Add entire states to Mina state proof

* Change version of clap to work with aligned

* Fix tip state

* Change core crate name

* Make serialization mod public

* Add contract support for relative finalization

* Fixed smart contract update function

* Check state hashes

* Fix hash store

* Fix clippy

* Remove unnecessary match case

* Fix aligned-sdk dependency
* Added merkle query

* Rename query_and_serialize

* WIP merkle query

* Fix test

* WIP Account query

* Finished account query

* Fixed TokenId deserialization

* Remove account query

* Fix clippy

* Removed account_inclusion crate

* Take into account mina account proofs

* Add CLI commands

* Implement submission code for account proof

* Add ledger hash to state verifier

* Add accountIdHash and account verification feature for smart contract

* Add eth call for update account

* Fix clippy

* Update makefile rules

* Update specification

* Added doc to smart contract

* Fix clippy

* Update README.md

* Query candidate chain, use bincode

* Update Makefile

* Fix aligned sdk git dependency

* Update cargo.lock

* Define new state proof, serialize with bincode

* Change proof field types

* Refactor proof definition

* Add entire states to Mina state proof

* Change version of clap to work with aligned

* Fix tip state

* Change core crate name

* Make serialization mod public

* Add contract support for relative finalization

* Fixed smart contract update function

* Check state hashes

* Fix hash store

* Fix clippy

* Remove account hash from contract storage

* Fix clippy
* Added merkle query

* Rename query_and_serialize

* WIP merkle query

* Fix test

* WIP Account query

* Finished account query

* Fixed TokenId deserialization

* Remove account query

* Fix clippy

* Removed account_inclusion crate

* Take into account mina account proofs

* Add CLI commands

* Implement submission code for account proof

* Add ledger hash to state verifier

* Add accountIdHash and account verification feature for smart contract

* Add eth call for update account

* Fix clippy

* Update makefile rules

* Update specification

* Added doc to smart contract

* Fix clippy

* Update README.md

* Query candidate chain, use bincode

* Update Makefile

* Fix aligned sdk git dependency

* Update cargo.lock

* Define new state proof, serialize with bincode

* Change proof field types

* Refactor proof definition

* Add entire states to Mina state proof

* Change version of clap to work with aligned

* Fix tip state

* Change core crate name

* Make serialization mod public

* Add contract support for relative finalization

* Fixed smart contract update function

* Check state hashes

* Fix hash store

* Fix clippy

* Remove account hash from contract storage

* Fix clippy

* New account proof WIP

* Finish new account proof

* Remove unused dependencies

* Add new schema

* Intergrate new account query schema

* Change mina proof to store account

* Replace ledger hash with Fp

* Update comment

* Fix variable name

* Change staged ledger hash to snarked

* Fix clippy
* Update Aligned

* Make aligned SDK point to correct branch

* Fix wallet chain ID

* Update dependencies

* Make aligned SDK point to mina branch
…nt inclusion proof (#334)

* Added merkle query

* Rename query_and_serialize

* WIP merkle query

* Fix test

* WIP Account query

* Finished account query

* Fixed TokenId deserialization

* Remove account query

* Fix clippy

* Removed account_inclusion crate

* Take into account mina account proofs

* Add CLI commands

* Implement submission code for account proof

* Add ledger hash to state verifier

* Add accountIdHash and account verification feature for smart contract

* Add eth call for update account

* Fix clippy

* Update makefile rules

* Update specification

* Added doc to smart contract

* Fix clippy

* Update README.md

* Query candidate chain, use bincode

* Update Makefile

* Fix aligned sdk git dependency

* Update cargo.lock

* Define new state proof, serialize with bincode

* Change proof field types

* Refactor proof definition

* Add entire states to Mina state proof

* Change version of clap to work with aligned

* Fix tip state

* Change core crate name

* Make serialization mod public

* Add contract support for relative finalization

* Fixed smart contract update function

* Check state hashes

* Fix hash store

* Fix clippy

* Remove account hash from contract storage

* Fix clippy

* New account proof WIP

* Finish new account proof

* Remove unused dependencies

* Add new schema

* Intergrate new account query schema

* Change mina proof to store account

* Replace ledger hash with Fp

* Update comment

* Fix variable name

* Change staged ledger hash to snarked

* Fix clippy

* MinaAccountValidation lib

* Gen abi of new lib

* Add Mina account solidity struct

* Update contract

* Refactor serialization, add account conversion

* Doc

* Change mina account proof to use encoded account

* Readd mina account in proof

* Handle new proof in smart contract

* Fix contract
* Sync with Aligned 0.5.2

* Start updating Aligned to 0.6.0

* Fix Aligned version update
Currently points to the `update_to_06` branch which no longer exists
gabrielbosio and others added 13 commits September 19, 2024 11:10
* Point SDK to mina branch

* Point Aligned submodule to mina branch
* [WIP] Update Aligned to 0.7.0

We must wait until Aligned uploads the release for 0.7.0.

Once it's uploaded we need to add a batcher payment service arg
to the `updateChain` call in the Aligned polling service.

* Update Aligned to 0.7.0

* Update Aligned branch

* Update Aligned and Bridge contracts

* Update Aligned Foundry submodule
* Init bun project

* Refactor

* chore: forge init

* forge install: forge-std

v1.9.2

* Rename Counter to Sudoku

* forge install: mina_bridge

132e4ea

* Contract mockup

* Add remappings, fix version

* Remove unused files, add contract constructor

* Remove mina_bridge submodule

* Rename zkapp

* Rename app to example

* forge install: forge-std

v1.9.2

* Created Rust app project

* zkApp script

* Fiz zkapp script

* Core refactor

* Add sdk

* Complete app

* Change zkapp address to constant

* Updated rust app

* Rename mina_contract to mina_zkapp

* Completed sudoku eth contract

* [WIP] Update Aligned to 0.7.0

We must wait until Aligned uploads the release for 0.7.0.

Once it's uploaded we need to add a batcher payment service arg
to the `updateChain` call in the Aligned polling service.

* Update Aligned to 0.7.0

* Update Aligned branch

* Finish sudoku contract deployer

* Rename sudoku contract

* Fix contract deployer

* Update Aligned and Bridge contracts

* Update Aligned Foundry submodule

* Add call to SudokuValidity, small fixes to contract

* Update makefile

* Add better log and getter function for timestamp

* Fix contract validateAccount call

* Add retrying logic for mina zkapp

* Fix Makefile

* Zkapp fixes

* Fix ledger hash search

* Add log

* Fix boolean comparison

* Add debug to query_candidate_chain()

* Update app

* Update to aligned 0.7

* Update constants

* Change zkapp config

* Fix clippy

* Add example diagram

---------

Co-authored-by: gabrielbosio <[email protected]>
* [WIP] Update Aligned to 0.7.0

We must wait until Aligned uploads the release for 0.7.0.

Once it's uploaded we need to add a batcher payment service arg
to the `updateChain` call in the Aligned polling service.

* Update Aligned to 0.7.0

* Update Aligned branch

* Update Aligned and Bridge contracts

* Update Aligned Foundry submodule

* Add Proving system ID commitment check

* Update core lockfile

* Fix ABIs

* Remove unused Solidity error

* Update ABIs
* [WIP] Update Aligned to 0.7.0

We must wait until Aligned uploads the release for 0.7.0.

Once it's uploaded we need to add a batcher payment service arg
to the `updateChain` call in the Aligned polling service.

* Update Aligned to 0.7.0

* Update Aligned branch

* Update Aligned and Bridge contracts

* Update Aligned Foundry submodule

* Remove bridge addr constants and parameterize them
* Fix state proof doc

* Fix account proof doc

* Update example

* Update README

* Update README'

* Add new specification

* Update table of contents

* Fix specification paragraph

* Add sdk docs

* Update use case readme

* Small changes

* Fix identation

* Fix identation

* Fix identation

* Modify top level desc

* Update config.json

* Update zkapp config

* Update README.md

Co-authored-by: Gabriel Bosio <[email protected]>

* Update README.md

Co-authored-by: Gabriel Bosio <[email protected]>

* Update README.md

Co-authored-by: Gabriel Bosio <[email protected]>

---------

Co-authored-by: Gabriel Bosio <[email protected]>
@xqft xqft marked this pull request as ready for review September 27, 2024 19:28
xqft and others added 7 commits October 1, 2024 11:18
* [WIP] Start adding devnet flag

* Add devnet flag

* Point SDK to Mina branch

* Lock SDK branch

* Fix settlement contract

* Parameterize state and account contract addresses

* Update example address and unwrap bridge addresses

* Update Aligned

* Reuse BATCHER_ETH_ADDR

* Point SDK to VK branch

* Replace aligned SM env var name with used in SDK

* Fix clippy

* Remove zkapp state logging
* [WIP] Start adding devnet flag

* Add devnet flag

* Point SDK to Mina branch

* Lock SDK branch

* Fix settlement contract

* Parameterize state and account contract addresses

* Update example address and unwrap bridge addresses

* Update Aligned

* Reuse BATCHER_ETH_ADDR

* Point SDK to VK branch

* Replace aligned SM env var name with used in SDK

* Fix clippy

* Remove zkapp state logging

* Parameterize Sudoku Holesky address
* Add details on usage section

* Start adding Ethereum testnet section

* Complete setup section

* Fix Mainnet image link

* Fix Aligned fork branch

* Add staking step in Testnet setup

* Complete Aligned Testnet setup

* Update README.md

* Revert "Update README.md"

This reverts commit 2f68a5d.

* Update submit state command

* Fix Testnet setup ordered list

* Update batcher deployment result paragraph

---------

Co-authored-by: Estéfano Bargas <[email protected]>
Base automatically changed from aligned to main October 3, 2024 17:48
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.

2 participants