Aj/contracts#63
Conversation
| pragma solidity ^0.8.20; | ||
|
|
||
| library ImageID { | ||
| bytes32 public constant ADAPTER_ID = bytes32(0x35e11aa083da4b62f64a80c2b731097e5dcf9b0608a9689cd10b4633d56dcc7a); |
There was a problem hiding this comment.
Do we need this?
There was a problem hiding this comment.
actually we need this when we are using the nexus manager contract with ethereum mock geth adapter.
| contract NexusProofManager { | ||
| uint256 public latestNexusBlockNumber = 0; | ||
| RiscZeroVerifierRouter public immutable risc0Router; | ||
| bytes32 public constant imageId = ImageID.ADAPTER_ID; // added for the auto-generated contract |
There was a problem hiding this comment.
Can we make this configurable? Only guardian should be able to update nexus image ID
There was a problem hiding this comment.
there is no guardian config in this contract. Adding this.
| } | ||
| // TODO : include a verification check after finalization | ||
| // ! Do not use this code in production. | ||
| availBridgeRootToAvailHeight[bridgeRoot] = availBlockNumber; |
There was a problem hiding this comment.
We need to store this against nexus block number, so we are able to retrieve it with getChainState. AppAddress is 0 hash.
There was a problem hiding this comment.
in doc it is written that :
Stores the avail bridge root, mapped to avail height. Got confused let's discuss this on call
| availBridgeRootToAvailHeight[bridgeRoot] = availBlockNumber; | ||
| } | ||
|
|
||
| function getChainState(uint256 blockNumber, bytes32 nexusAppID) external view returns (bytes32) { |
There was a problem hiding this comment.
Can we rename all AppID to AppAddress?
|
|
||
| pragma solidity ^0.8.20; | ||
|
|
||
| library ImageID { |
There was a problem hiding this comment.
We do not need this
There was a problem hiding this comment.
We need this when running the nexus manager with zksync adapter.
| uint256 | ||
| ) external view returns (bytes32); | ||
| function nexusAppIDToLatestBlockNumber(bytes32) external view returns (uint256); | ||
| function nexusAppIDToState(bytes32, uint256) external view returns (bytes32); |
There was a problem hiding this comment.
this is same as getChainState, right?
There was a problem hiding this comment.
If it is, good to remove this in the same PR so we do not forget later
| @@ -12,19 +12,12 @@ library JellyfishMerkleTreeVerifier { | |||
| bytes32[] siblings; | |||
There was a problem hiding this comment.
Skipping checking this file, as I assume it is only lint changes
| @@ -0,0 +1,123 @@ | |||
| // SPDX-License-Identifier: Apache-2.0 | |||
There was a problem hiding this comment.
Not checking this file. Please confirm if you have checked that it works.
|
|
||
| library Elf { | ||
| string public constant ADAPTER_PATH = | ||
| "/Users/ocdbytes/Desktop/Avail/nexus/target/riscv-guest/geth-methods/adapter/riscv32im-risc0-zkvm-elf/release/adapter"; |
There was a problem hiding this comment.
Do we need this for the tests?
|
|
||
| library Elf { | ||
| string public constant ZKSYNC_ADAPTER_PATH = | ||
| "/Users/ocdbytes/Desktop/Avail/nexus/target/riscv-guest/zksync-methods/zksync-adapter/riscv32im-risc0-zkvm-elf/release/zksync-adapter"; |
There was a problem hiding this comment.
Just confirming if we need this as well
| } | ||
| let proof = tree.get_with_proof(KeyHash(key.as_fixed_slice().clone()), version)?; | ||
|
|
||
| println!(">>> root hash : {:?}", jmt::RootHash(root.as_fixed_slice().clone())); |
There was a problem hiding this comment.
Can be removed or changed to tracing debug
There was a problem hiding this comment.
Also same for all below similar lines
| let proof = tree.get_with_proof(KeyHash(key.as_fixed_slice().clone()), version)?; | ||
|
|
||
| println!(">>> root hash : {:?}", jmt::RootHash(root.as_fixed_slice().clone())); | ||
| println!(">>> key hash : {:?}", hex::encode(key.as_fixed_slice().clone())); |
There was a problem hiding this comment.
Same as above.
No description provided.