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

Debug cctl batch failing (Ready to merge) #177

Merged
merged 7 commits into from
Aug 6, 2024
Merged

Conversation

Avi-D-coder
Copy link
Contributor

@Avi-D-coder Avi-D-coder commented Jul 31, 2024

This PR shows that the same exact proof testdata/proof-from-server.json works as expected in the test execution engine, but fails under cctl with Interpreter error: trap: Code(Unreachable)

This also upgrades risc0, and improves error handling, once verify under cctl is work we can fixup the pr to remove debug logic done.

@Avi-D-coder
Copy link
Contributor Author

Ok it's working against cctl now.

kairos on  debug-cctl-batch-failing [$!] is 📦 v0.1.0 via 🦀 v1.79.0 via ❄️  impure (nix-shell-env) 
❯ cargo run --release --bin kairos-server --no-default-features
warning: /Users/avi/Code/Casper/kairos/kairos-cli/Cargo.toml: unused manifest key: bin.0.version
warning: /Users/avi/Code/Casper/kairos/kairos-contracts/demo-contract/contract-utils/Cargo.toml: `default-features` is ignored for casper-event-standard, since `default-features` was not specified for `workspace.dependencies.casper-event-standard`, this could become a hard error in the future
warning: /Users/avi/Code/Casper/kairos/Cargo.toml: unused manifest key: workspace.package.name
warning: /Users/avi/Code/Casper/kairos/kairos-test-utils/Cargo.toml: unused manifest key: bin.0.version
    Finished `release` profile [optimized] target(s) in 0.21s
     Running `target/release/kairos-server`
2024-07-31T00:41:27.772127Z  INFO kairos_server: listening on `0.0.0.0:9999`
2024-07-31T00:41:27.772599Z  INFO kairos_server::l1_sync::event_manager: Initializing event manager
2024-07-31T00:41:27.782755Z  INFO kairos_server::l1_sync::event_manager: Looking for new events
2024-07-31T00:41:37.783776Z  INFO kairos_server::l1_sync::event_manager: Looking for new events
2024-07-31T00:41:37.787656Z  INFO kairos_server::state::transactions::batch_state: Executing deposit: L1Deposit { recipient: [1, 175, 121, 242, 139, 222, 69, 34, 178, 126, 219, 141, 201, 223, 20, 108, 157, 58, 101, 249, 68, 187, 220, 241, 83, 234, 16, 123, 41, 27, 174, 35, 45], amount: 500 }
2024-07-31T00:41:47.784036Z  INFO kairos_server::l1_sync::event_manager: Looking for new events
2024-07-31T00:41:47.787780Z  INFO kairos_server::state::transactions::batch_state: Executing deposit: L1Deposit { recipient: [1, 175, 121, 242, 139, 222, 69, 34, 178, 126, 219, 141, 201, 223, 20, 108, 157, 58, 101, 249, 68, 187, 220, 241, 83, 234, 16, 123, 41, 27, 174, 35, 45], amount: 500 }
2024-07-31T00:41:47.787997Z  INFO kairos_server::state: Sending batch output to proving server: [Deposit(L1Deposit { recipient: [1, 175, 121, 242, 139, 222, 69, 34, 178, 126, 219, 141, 201, 223, 20, 108, 157, 58, 101, 249, 68, 187, 220, 241, 83, 234, 16, 123, 41, 27, 174, 35, 45], amount: 500 }), Deposit(L1Deposit { recipient: [1, 175, 121, 242, 139, 222, 69, 34, 178, 126, 219, 141, 201, 223, 20, 108, 157, 58, 101, 249, 68, 187, 220, 241, 83, 234, 16, 123, 41, 27, 174, 35, 45], amount: 500 })]
2024-07-31T00:41:48.848780Z  INFO kairos_server::state: Proving server returned success
2024-07-31T00:41:48.850268Z  INFO kairos_server::state::submit_batch: Submitting proof to contract: ContractHash(1689e4f3b82bcdc7fdaf7253738bb58297ca8dfc6aa9741ec7468a943c8a681a)
2024-07-31T00:41:57.784246Z  INFO kairos_server::l1_sync::event_manager: Looking for new events
2024-07-31T00:41:59.895322Z  INFO kairos_server::state::submit_batch: Deploy successful: SuccessResponse { jsonrpc: "2.0", id: Number(8396921001411452868), result: PutDeployResult { api_version: ProtocolVersion(SemVer { major: 1, minor: 0, patch: 0 }), deploy_hash: DeployHash(1c3e753408b9d0898ea3904ac4eed124c480867790e664b79606a7ccdc9de0a8) } }
2024-07-31T00:42:07.783945Z  INFO kairos_server::l1_sync::event_manager: Looking for new events
2024-07-31T00:42:17.784337Z  INFO kairos_server::l1_sync::event_manager: Looking for new events
2024-07-31T00:42:27.783720Z  INFO kairos_server::l1_sync::event_manager: Looking for new events
2024-07-31T00:42:37.784136Z  INFO kairos_server::l1_sync::event_manager: Looking for new events
2024-07-31T00:42:47.783615Z  INFO kairos_server::l1_sync::event_manager: Looking for new events
2024-07-31T00:42:57.783104Z  INFO kairos_server::l1_sync::event_manager: Looking for new events
2024-07-31T00:43:07.783500Z  INFO kairos_server::l1_sync::event_manager: Looking for new events
2024-07-31T00:43:17.783821Z  INFO kairos_server::l1_sync::event_manager: Looking for new events
2024-07-31T00:43:27.784295Z  INFO kairos_server::l1_sync::event_manager: Looking for new events
2024-07-31T00:43:37.784184Z  INFO kairos_server::l1_sync::event_manager: Looking for new events
2024-07-31T00:43:44.346166Z  INFO kairos_server::routes::withdraw: parsing transaction data
2024-07-31T00:43:44.346220Z  INFO kairos_server::routes::withdraw: queuing withdrawal transaction
2024-07-31T00:43:44.346242Z  INFO kairos_server::state::transactions::batch_state: Executing withdraw: Signed { public_key: [1, 175, 121, 242, 139, 222, 69, 34, 178, 126, 219, 141, 201, 223, 20, 108, 157, 58, 101, 249, 68, 187, 220, 241, 83, 234, 16, 123, 41, 27, 174, 35, 45], nonce: 0, transaction: Withdraw { amount: 500 } }
2024-07-31T00:43:44.346293Z  INFO kairos_server::state: Sending batch output to proving server: [Withdraw(Signed { public_key: [1, 175, 121, 242, 139, 222, 69, 34, 178, 126, 219, 141, 201, 223, 20, 108, 157, 58, 101, 249, 68, 187, 220, 241, 83, 234, 16, 123, 41, 27, 174, 35, 45], nonce: 0, transaction: Withdraw { amount: 500 } })]
2024-07-31T00:43:45.365829Z  INFO kairos_server::state: Proving server returned success
2024-07-31T00:43:45.367180Z  INFO kairos_server::state::submit_batch: Submitting proof to contract: ContractHash(1689e4f3b82bcdc7fdaf7253738bb58297ca8dfc6aa9741ec7468a943c8a681a)
2024-07-31T00:43:47.783988Z  INFO kairos_server::l1_sync::event_manager: Looking for new events
2024-07-31T00:43:56.169767Z  INFO kairos_server::state::submit_batch: Deploy successful: SuccessResponse { jsonrpc: "2.0", id: Number(5867942540743301488), result: PutDeployResult { api_version: ProtocolVersion(SemVer { major: 1, minor: 0, patch: 0 }), deploy_hash: DeployHash(63e5be9a16dec27acddb0c32079a5515363176ed15a53aab645776cfdd62feb9) } }
2024-07-31T00:43:57.783511Z  INFO kairos_server::l1_sync::event_manager: Looking for new events
2024-07-31T00:44:07.783988Z  INFO kairos_server::l1_sync::event_manager: Looking for new events

@Avi-D-coder Avi-D-coder changed the title Debug cctl batch failing Debug cctl batch failing (Ready to merge) Jul 31, 2024
@@ -12,7 +12,8 @@ name = "kairos-server"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
default = ["cctl-tests", "deposit-mock", "database"]
# TODO readd database to default features once we have a nix module for postgres
default = ["cctl-tests", "deposit-mock"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have a nix module for postgres

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not one for the dev shell.

Some(secret_key_file) => {
if SecretKey::from_file(secret_key_file).is_err() {
return Err("Invalid secret key".to_string());
let secret_key_file = parse_env_as_opt::<String>("KAIROS_SERVER_SECRET_KEY_FILE")?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somehow I didn't see this earlier, where is this secret key file read from?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

testdata in the root of the repo. see .env

@koxu1996
Copy link
Contributor

In this PR chainspec was updated - before, after - and the most important change is increasing max_memory limit from 64 to 640. That alone finally fixes withdraw functionality 😄.

@koxu1996 koxu1996 mentioned this pull request Jul 31, 2024
@marijanp marijanp merged commit ed0ba18 into main Aug 6, 2024
4 checks passed
@marijanp marijanp deleted the debug-cctl-batch-failing branch August 6, 2024 11:13
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.

3 participants