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

Complete the make transfer command #31

Open
2 of 6 tasks
cmwaters opened this issue Dec 12, 2024 · 8 comments
Open
2 of 6 tasks

Complete the make transfer command #31

cmwaters opened this issue Dec 12, 2024 · 8 comments
Assignees

Comments

@cmwaters
Copy link
Collaborator

cmwaters commented Dec 12, 2024

The last command in the demo should transfer tokens from simapp to the reth rollup. This requires the following steps:

  • Submit MsgTransfer to simapp commencing the process. See feat: submit MsgTransfer #50
  • Update the tendermint client on the reth rollup (querying the prover process for the groth16 proof proving the simapps state transition from a previous trusted height to a new one) feat: Submit MsgUpdateClient to tendermint light client #67
  • Query the membership proof of the commitment on simapp and attach that proof to the transfer packet that needs to be sent to the reth rollup (I think to the router smart contract)
  • Update the groth16 Client on simapp by using the prover process running over the reth node
  • Now query the MPT membership proof on the reth node of the acknowledgement commitment and embed it in the acknowledgement packet that needs to be submitted on simapp.
  • Query the balances and assert that the tokens have correctly been transferred.
@rootulp
Copy link
Collaborator

rootulp commented Dec 12, 2024

AFAIK this is blocked on #30 because the clients and channel need to be set up before we try to update the clients and use the connection.

I can explore creating a mock client and channel if #30 isn't ready yet cc: @ninabarbakadze

@cmwaters
Copy link
Collaborator Author

Yes you won't be able to test this flow until #30 is completed but I think you can already write most of the code

@cmwaters
Copy link
Collaborator Author

I think you can get a lot of inspiration from: https://github.com/cosmos/solidity-ibc-eureka/blob/main/e2e/interchaintestv8/ibc_eureka_test.go

@rootulp
Copy link
Collaborator

rootulp commented Dec 16, 2024

Submit MsgTransfer to simapp commencing the process

Nina already wrote logic for broadcasting + confirming transactions inside #34. May need to generalize it.

Update the tendermint client on the reth rollup (querying the prover process for the groth16 proof proving the simapps state transition from a previous trusted height to a new one)

  1. Query the prover GRPC service that Callum just wrote. It is running on port 50051. Need a README or demo on how that works. There is Go client code for this already.
  2. Submit a tx on the Reth roll-up to the tendermint light client with the proof. Invoke sp1ics07tendermint's NewContract so that we can call... (needs more research).

Steps 2 - 5 use proofs. It will take a lot of time to generate those proofs. Instead use mock proofs from #40

@rootulp
Copy link
Collaborator

rootulp commented Dec 19, 2024

For Tendermint chains:

  • Multiple messages (UpdateClient, MsgTransfer) get bundled into one tx.

For EVM chains:

  • We don't know which order we need to send the txs in.

@rootulp
Copy link
Collaborator

rootulp commented Dec 23, 2024

Clarification: steps 2 - 5 are responsibilities of the relayer. See #63 for a more detailed breakdown of what each step entails.

@rootulp
Copy link
Collaborator

rootulp commented Jan 3, 2025

A few notes on the relayer from sprint planning:

  • Don’t create a separate service or process for the relayer.
    • Do something similar to the ibc-go repo e2e tests which uses Go code to execute the steps of what a relayer would do.
    • IBC team built a one-off relayer inside the solidity IBC repo. Written in Rust. Just exists for end-to-end tests. Would have to be modified for our Groth16 proofs. Use for inspiration.
    • Look at Voyager (built by Union) for inspiration but it uses a different EVM contract.
  • The solidity implementation of IBC Eureka has event emission.

@rootulp
Copy link
Collaborator

rootulp commented Jan 24, 2025

A more detailed write-up exists in the README.

rootulp added a commit that referenced this issue Jan 28, 2025
Closes step two of
#31.

A few changes in this PR, can split them into separate PRs if reviewers
request:
1. Checkout submodules in CI workflows lint and test.
2. Sort makefile commands alphabetically. Add a new `make relay` command
that does step 2.
3. Update README with an important step to apply a diff in
`solidity-ibc-eureka/justfile`. The diff is needed so that the
Tendermint light client on the EVM roll-up supports Groth16 and has the
correct verifier key (from the celestia-prover)
4. Enable debug mode on Reth node (can revert if requested)
5. Add `curl` to the Celestia-prover for debugging purposes (can revert
if requested)
6. Update solidity-ibc-eureka version
7. Modify the prover proto to return hex-encoded verifier keys. This
made it easier to plumb directly into the EVM contract and Tendermint
light client set-up (can revert if requested)
8. Add a line to celestia-prover README to show example usage of `Info`
endpoint
9. Add a debug-txhash script to help debug failed EVM transactions (can
revert if requested)
10. Refactor the `extractDeployedContractAddresses` to utils package so
that it can be used in multiple places
11. Refactor the `transfer` script

## Testing

I can't run the celestia-prover in Docker because
#89 but if
I run it locally, it works:

```
$ make relay
go run testing/demo/pkg/relay/main.go
Extracted deployed contract addresses: utils.ContractAddresses{ERC20:"0xa05915fd6e32a1aa7e67d800164cacb12487142d", Escrow:"0xc4515dd838dd640d6839933b33ff8d19640c1231", IBCStore:"0xf73bd8a7184bec941b3f9ef5e6f6df981e105535", ICS07Tendermint:"0xe53275a1fca119e1c5eeb32e7a72e54835a63936", ICS20Transfer:"0xb1c938f5ba4b3593377f399e12175e8db0c787ff", ICS26Router:"0x48fd1226d797400779bbfaf1706f5fb8da04ae91", ICSCore:"0x7e7ad18adc99b94d4c728fdf13d4de97b926a0d8"}
Getting celestia prover info...
Got celestia prover info. StateTransitionVerifierKey: 0x0081282e1279b92586a3330c1cd83a3f0910299bdc7be90ac1a24b2a0826523bInvoking icsCore.UpdateClient...
Transaction hash: 0x6370b144be660a5d8f798c45fe3f1942735e7a86063dc1834b61013f04de3b11
Block number: 170
Gas used: 289132
Logs: []
recvBlockNumber 170
```
ninabarbakadze pushed a commit that referenced this issue Jan 29, 2025
Closes step two of
#31.

A few changes in this PR, can split them into separate PRs if reviewers
request:
1. Checkout submodules in CI workflows lint and test.
2. Sort makefile commands alphabetically. Add a new `make relay` command
that does step 2.
3. Update README with an important step to apply a diff in
`solidity-ibc-eureka/justfile`. The diff is needed so that the
Tendermint light client on the EVM roll-up supports Groth16 and has the
correct verifier key (from the celestia-prover)
4. Enable debug mode on Reth node (can revert if requested)
5. Add `curl` to the Celestia-prover for debugging purposes (can revert
if requested)
6. Update solidity-ibc-eureka version
7. Modify the prover proto to return hex-encoded verifier keys. This
made it easier to plumb directly into the EVM contract and Tendermint
light client set-up (can revert if requested)
8. Add a line to celestia-prover README to show example usage of `Info`
endpoint
9. Add a debug-txhash script to help debug failed EVM transactions (can
revert if requested)
10. Refactor the `extractDeployedContractAddresses` to utils package so
that it can be used in multiple places
11. Refactor the `transfer` script

I can't run the celestia-prover in Docker because
#89 but if
I run it locally, it works:

```
$ make relay
go run testing/demo/pkg/relay/main.go
Extracted deployed contract addresses: utils.ContractAddresses{ERC20:"0xa05915fd6e32a1aa7e67d800164cacb12487142d", Escrow:"0xc4515dd838dd640d6839933b33ff8d19640c1231", IBCStore:"0xf73bd8a7184bec941b3f9ef5e6f6df981e105535", ICS07Tendermint:"0xe53275a1fca119e1c5eeb32e7a72e54835a63936", ICS20Transfer:"0xb1c938f5ba4b3593377f399e12175e8db0c787ff", ICS26Router:"0x48fd1226d797400779bbfaf1706f5fb8da04ae91", ICSCore:"0x7e7ad18adc99b94d4c728fdf13d4de97b926a0d8"}
Getting celestia prover info...
Got celestia prover info. StateTransitionVerifierKey: 0x0081282e1279b92586a3330c1cd83a3f0910299bdc7be90ac1a24b2a0826523bInvoking icsCore.UpdateClient...
Transaction hash: 0x6370b144be660a5d8f798c45fe3f1942735e7a86063dc1834b61013f04de3b11
Block number: 170
Gas used: 289132
Logs: []
recvBlockNumber 170
```
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

No branches or pull requests

2 participants