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

feat(verifier) Add nexus verifier #1175

Open
wants to merge 10 commits into
base: testnet
Choose a base branch
from
Open

Conversation

PatStiles
Copy link
Contributor

@PatStiles PatStiles commented Oct 4, 2024

closes #1159

Currently the batcher fails to compile due to a dependency discrepancy between risc0-zkvm and nexus-core relying on different version of ark-groth16. To observe this comment the crate declaration for risc0 in batcher/Cargo.toml and run cargo build. You should observe that the batcher compiles but errors due to the risc0 dependency not being present.
Screenshot 2024-10-04 at 04 02 16

Note: When previously testing this intengration the msg size of the websocket was not large enough to process some proofs: https://github.com/yetanotherco/aligned_layer/pull/1175/files#diff-fb54942eba81c272160ef10dfb2972fd0a6de56d45ed87c98ca1a65b3b2dd29bR386.

To Test:

  • Run make test_nexus_rust_ffi and make test_nexus_go_bindings_macos/make test_nexus_go_bindings_linux
  • Run local testnet and send a Nexus proofs to the batcher by running make batcher_send_nexus_burst and confirm they are accpeted.

@PatStiles PatStiles self-assigned this Oct 4, 2024
@Oppen
Copy link
Collaborator

Oppen commented Oct 4, 2024

I resumed work on this today. Right now, it seems to verify correctly, but I observe some errors on the logs:

[2024-10-04T21:59:33Z INFO  aligned_batcher] Verifying message signature...                                                                                    
[2024-10-04T21:59:34Z INFO  ethers_providers::rpc::transports::ws::manager] handle_notification; server_id=120157283383023606639807874407129176135
[2024-10-04T21:59:34Z INFO  aligned_batcher] Received new block: 34                                                                                            
[2024-10-04T21:59:34Z INFO  ethers_providers::rpc::transports::ws] make_request; method="eth_gasPrice"                                                                                                                                          
[2024-10-04T21:59:34Z INFO  ethers_providers::rpc::transports::ws::manager] service_request; id=18 method="eth_gasPrice"                                                                                                                        
[2024-10-04T21:59:34Z INFO  ethers_providers::rpc::transports::ws::manager] req_success; id=18                                                                                                                                                  
[2024-10-04T21:59:34Z INFO  aligned_batcher] Current batch is empty or length 1. Waiting for more proofs...                                                                                                                                     
[2024-10-04T21:59:34Z INFO  ethers_providers::rpc::transports::ws::manager] handle_notification; server_id=88286777803820389119586666700228229746                                                                                               
localstack-main  | 2024-10-04T21:59:34.121  INFO --- [et.reactor-0] localstack.request.aws     : AWS s3.GetObject => 200                                                                                                                        
[2024-10-04T21:59:34Z INFO  aligned_batcher] Message signature verified                                                                                                                                                                         
[2024-10-04T21:59:34Z INFO  aligned_batcher::nexus] Verifying Nexus Proof                                                                                                                                                                       
[2024-10-04T21:59:40Z INFO  aligned_batcher] Batch verification task created on Aligned contract                                                                                                                                                
[2024-10-04T21:59:40Z INFO  aligned_batcher] Response sent                                                                                                                                                                                      
[2024-10-04T21:59:40Z INFO  aligned_batcher] Response sent                                                                                                                                                                                      
[2024-10-04T21:59:40Z INFO  aligned_batcher] Current batch is empty or length 1. Waiting for more proofs...                                                                                                                                     
[2024-10-04T21:59:41Z INFO  ethers_providers::rpc::transports::ws::manager] handle_notification; server_id=120157283383023606639807874407129176135                                                                                              
[2024-10-04T21:59:41Z INFO  aligned_batcher] Received new block: 35                                                                                                                                                                             
[2024-10-04T21:59:41Z INFO  ethers_providers::rpc::transports::ws] make_request; method="eth_gasPrice"                                                                                                                                          
[2024-10-04T21:59:41Z INFO  ethers_providers::rpc::transports::ws::manager] service_request; id=19 method="eth_gasPrice"                                                                                                                        
[2024-10-04T21:59:41Z INFO  ethers_providers::rpc::transports::ws::manager] handle_notification; server_id=88286777803820389119586666700228229746                                                                                               
[2024-10-04T21:59:41Z INFO  ethers_providers::rpc::transports::ws::manager] req_success; id=19                                                                                                                                                  
[2024-10-04T21:59:41Z INFO  aligned_batcher] Current batch is empty or length 1. Waiting for more proofs...                                                                                                                                     
[2024-10-04T21:59:41Z INFO  aligned_batcher] non paying nonce: 3                                                                                                                                                                                
[2024-10-04T21:59:41Z INFO  aligned_batcher] Calculating verification data commitments...                                                                                                                                                       
[2024-10-04T21:59:42Z INFO  aligned_batcher] Adding verification data to batch...                                                                                                                                                               
[2024-10-04T21:59:42Z INFO  aligned_batcher] Current batch queue length: 2                                              
[2024-10-04T21:59:42Z INFO  aligned_batcher] Verification data message handled                                          
[2024-10-04T21:59:42Z ERROR aligned_batcher] Unexpected error: IO error: Connection reset by peer (os error 54)                                                                                                                                 
[2024-10-04T21:59:48Z INFO  ethers_providers::rpc::transports::ws::manager] handle_notification; server_id=88286777803820389119586666700228229746                                                                                               
[2024-10-04T21:59:48Z INFO  aligned_batcher] Received new block: 36                                                     
[2024-10-04T21:59:48Z INFO  ethers_providers::rpc::transports::ws] make_request; method="eth_gasPrice"                                                                                                                                          
[2024-10-04T21:59:48Z INFO  ethers_providers::rpc::transports::ws::manager] handle_notification; server_id=120157283383023606639807874407129176135                                                                                              
[2024-10-04T21:59:48Z INFO  ethers_providers::rpc::transports::ws::manager] service_request; id=20 method="eth_gasPrice"                                                                                                                        
[2024-10-04T21:59:48Z INFO  ethers_providers::rpc::transports::ws::manager] req_success; id=20                                                                                                                                                  
[2024-10-04T21:59:51Z INFO  aligned_batcher] Finalizing batch. Length: 2                                                
[2024-10-04T21:59:51Z INFO  aligned_batcher] Batch Finalizer: Last uploaded batch block updated to: 36. Lock unlocked                                                                                                                           
[2024-10-04T21:59:51Z INFO  aligned_batcher] Batch merkle root: 0xbc23c10c2e96bee92b365ce1f1844912afb7af21c0bf7cc1d7a8634164474a5b                                                                                                              
[2024-10-04T21:59:51Z INFO  aligned_batcher] Uploading batch to S3...                                                   
localstack-main  | 2024-10-04T21:59:53.388  INFO --- [et.reactor-0] localstack.request.aws     : AWS s3.PutObject => 200                                                                                                                        
[2024-10-04T21:59:53Z INFO  aligned_batcher] Batch sent to S3 with name: bc23c10c2e96bee92b365ce1f1844912afb7af21c0bf7cc1d7a8634164474a5b.json                                                                                                  
[2024-10-04T21:59:53Z INFO  aligned_batcher] Uploading batch to contract                                                
[2024-10-04T21:59:53Z INFO  aligned_batcher] Creating task for: 0xbc23c10c2e96bee92b365ce1f1844912afb7af21c0bf7cc1d7a8634164474a5b                                                                                                              
[2024-10-04T21:59:53Z INFO  aligned_batcher::eth] Creating task for: bc23c10c2e96bee92b365ce1f1844912afb7af21c0bf7cc1d7a8634164474a5b                                                                                                           
[2024-10-04T21:59:53Z WARN  aligned_batcher] Transaction reverted "0x3102f10c02a44cc13dfd86785d5f7b4f2ac8c0a3a30968146ed9ad937b19855d3906553d"                                                                                                  
[2024-10-04T21:59:53Z ERROR aligned_batcher] Failed to send batch to contract, batch will be lost: Error sending tx                                                                                                                             
[2024-10-04T21:59:53Z ERROR aligned_batcher] Error while sending message: IO error: Broken pipe (os error 32)                                                                                                                                   
[2024-10-04T21:59:53Z ERROR aligned_batcher] Error while sending message: IO error: Broken pipe (os error 32)                                                                                                                                   
[2024-10-04T21:59:53Z WARN  aligned_batcher] Resetting state... Flushing queue and nonces                                                                                                                                                       
[2024-10-04T21:59:53Z ERROR aligned_batcher] Error when handling new block: Error sending tx                                 

I'm not sure who the failing messages are directed to, but I suspect either Anvil or localstack reject my messages for surpassing the size limit, since I had to enlarge it for the batcher.

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.

feat(verifier): Finish Nexus Verifier
2 participants