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

CI fails #205

Open
Sword-Smith opened this issue Oct 12, 2024 · 1 comment
Open

CI fails #205

Sword-Smith opened this issue Oct 12, 2024 · 1 comment

Comments

@Sword-Smith
Copy link
Member

CI fails for these tests:

   models::state::global_state_tests::flaky_mutator_set_test
    models::state::global_state_tests::restore_wallet::offchain_generation_change_exists
    models::state::global_state_tests::restore_wallet::offchain_symmetric_change_exists
    models::state::global_state_tests::restore_wallet::onchain_generation_change_exists
    models::state::global_state_tests::restore_wallet::onchain_symmetric_change_exists
    models::state::mempool::tests::remove_transactions_with_block_test
    models::state::wallet::wallet_tests::wallet_state_maintanence_multiple_inputs_outputs_test
    rpc_server::rpc_server_tests::send_to_many_test

The code to estimate proving capabilities is defined in networking_state.rs as

 pub(crate) fn estimate_proving_power() -> TxProvingCapability {
        const SINGLE_PROOF_CORE_REQ: usize = 19;
        const SINGLE_PROOF_MEMORY_USAGE: u64 = (1u64 << 30) * 128;
        const PROOF_COLLECTION_CORE_REQ: usize = 2;
        const PROOF_COLLECTION_MEMORY_USAGE: u64 = (1u64 << 30) * 16;

        let s = System::new_all();
        let total_memory = s.total_memory();
        assert!(
            !total_memory.is_zero(),
            "Total memory reported illegal value of 0"
        );

        let physical_core_count = s.physical_core_count().unwrap_or(1);

        if total_memory > SINGLE_PROOF_MEMORY_USAGE && physical_core_count > SINGLE_PROOF_CORE_REQ {
            TxProvingCapability::SingleProof
        } else if total_memory > PROOF_COLLECTION_MEMORY_USAGE
            && physical_core_count > PROOF_COLLECTION_CORE_REQ
        {
            TxProvingCapability::ProofCollection
        } else {
            TxProvingCapability::LockScript
        }
    }

The CI runs on a machine with one core which sets the TxProvingCapability to LockScript, which is not implemented in create_transaction from_data_worker in GlobalState:

        let proof = match proving_power {
            TxProvingCapability::LockScript => todo!(),
            TxProvingCapability::ProofCollection => {
                TransactionProof::ProofCollection(ProofCollection::produce(&primitive_witness))
            }
            TxProvingCapability::SingleProof => {
                TransactionProof::SingleProof(SingleProof::produce(&primitive_witness))
            }
        };

The solution is probably just to implement LockScript proving capabilities by adding a new TransactionProof enum of Incomplete that maybe only produces a proof for the lock script and relies on peers to create the other proofs.

@aszepieniec
Copy link
Contributor

aszepieniec commented Oct 13, 2024

After a3fd237, the remaining failures are:

  • models::state::global_state_tests::restore_wallet::offchain_generation_change_exists
  • models::state::global_state_tests::restore_wallet::offchain_symmetric_change_exists
  • models::state::global_state_tests::restore_wallet::onchain_generation_change_exists
  • models::state::global_state_tests::restore_wallet::onchain_symmetric_change_exists
  • rpc_server::rpc_server_tests::send_to_many_test.

I expect only the last failure remains after a62ecd1.

This last test, send_to_many_test is tricky because it doesn't call create_transaction directly, and therefore there is no easy replacement with create_transaction_with_prover_capability.

An alternative to the solution you suggest might be (I'm not sure if it can work) to override the network configuration parameter in the test. Then the entire proving capability estimation would be bypassed.

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