Coder Social home page Coder Social logo

Comments (9)

elichai avatar elichai commented on July 20, 2024

Can you please run again with RUST_BACKTRACE=1 and post the backtrace?

from enigma-core.

fredfortier avatar fredfortier commented on July 20, 2024

Here is the output:

failures:
    boot_network::principal_manager::test::test_full_principal_logic

test result: FAILED. 3 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out

error: test failed, to rerun pass '--bin enigma_principal_app'
root@localhost:~/src/enigma-principal/app#
root@localhost:~/src/enigma-principal/app# clear
root@localhost:~/src/enigma-principal/app# cargo test
    Finished dev [unoptimized + debuginfo] target(s) in 0.22s
     Running target/debug/deps/enigma_principal_app-c63b82cdeec5ac7b

running 4 tests
Succeeded reading key from file
test esgx::equote::test::test_produce_quote ... ok

start running tests
Created file => seal_test.sealed
success writting to file!
Created file => seal_test.sealed
success writting to file!
testing test_full_sealing_storage ... ok!
testing test_signing ... ok!
testing test_ecdh ... ok!

test result ok. 3 tested, 3 passed, 0 failed
test tests::test_enclave_internal ... ok
Succeeded reading key from file
Succeeded reading key from file
test boot_network::deploy_scripts::test::test_deploy_enigma_contract_environment ... ok
deployed contract at address = 0xdb56…ed15
deployed dummy contract at address = 0xdb56f2e9369e0d7bd191099125a3f6c370f8ed15
⚒
test boot_network::principal_manager::test::test_full_principal_logic ... FAILED

failures:

---- boot_network::principal_manager::test::test_full_principal_logic stdout ----
[+] Home dir is /root
[+] Home dir is /root
[-] Create .enigma folder => AlreadyExists
The current directory is /root/src/enigma-principal/app
[+] Open token file success!
[+] Token file valid!
[+] Saved updated launch token!
[+] Init Enclave Successful 5!
deployed contract at address = 0x26b4…4aec
[+] Home dir is /root
deployed contract at address = 0x0e69…6337
thread 'boot_network::principal_manager::test::test_full_principal_logic' panicked at 'called `Result::unwrap()` on an `Err` value: Error("missing field `platformInfoBlob`", line: 1, column: 718)', libcore/result.rs:1009:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at libstd/sys_common/backtrace.rs:71
             at libstd/sys_common/backtrace.rs:59
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:211
   3: std::panicking::default_hook
             at libstd/panicking.rs:221
   4: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:476
   5: std::panicking::continue_panic_fmt
             at libstd/panicking.rs:390
   6: rust_begin_unwind
             at libstd/panicking.rs:325
   7: core::panicking::panic_fmt
             at libcore/panicking.rs:77
   8: core::result::unwrap_failed
             at libcore/macros.rs:26
   9: <core::result::Result<T, E>>::unwrap
             at libcore/result.rs:808
  10: enigma_tools_u::attestation_service::service::AttestationService::unwrap_report_obj
             at /root/src/enigma-tools-u/src/attestation_service/service.rs:143
  11: enigma_tools_u::attestation_service::service::AttestationService::unwrap_result
             at /root/src/enigma-tools-u/src/attestation_service/service.rs:156
  12: enigma_tools_u::attestation_service::service::AttestationService::unwrap_response
             at /root/src/enigma-tools-u/src/attestation_service/service.rs:161
  13: enigma_tools_u::attestation_service::service::AttestationService::send_request
             at /root/src/enigma-tools-u/src/attestation_service/service.rs:114
  14: enigma_tools_u::attestation_service::service::AttestationService::get_report
             at /root/src/enigma-tools-u/src/attestation_service/service.rs:92
  15: enigma_tools_u::attestation_service::service::AttestationService::rlp_encode_registration_params
             at /root/src/enigma-tools-u/src/attestation_service/service.rs:129
  16: <enigma_principal_app::boot_network::principal_manager::PrincipalManager as enigma_principal_app::boot_network::principal_manager::Sampler>::get_report
             at src/boot_network/principal_manager.rs:164
  17: <enigma_principal_app::boot_network::principal_manager::PrincipalManager as enigma_principal_app::boot_network::principal_manager::Sampler>::run
             at src/boot_network/principal_manager.rs:205
  18: enigma_principal_app::boot_network::principal_manager::test::test_full_principal_logic
             at src/boot_network/principal_manager.rs:363
  19: enigma_principal_app::boot_network::principal_manager::test::test_full_principal_logic::{{closure}}
             at src/boot_network/principal_manager.rs:279
  20: core::ops::function::FnOnce::call_once
             at libcore/ops/function.rs:238
  21: <F as alloc::boxed::FnBox<A>>::call_box
             at libtest/lib.rs:1468
             at libcore/ops/function.rs:238
             at liballoc/boxed.rs:661
  22: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:102


failures:
    boot_network::principal_manager::test::test_full_principal_logic

test result: FAILED. 3 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out

error: test failed, to rerun pass '--bin enigma_principal_app'

from enigma-core.

fredfortier avatar fredfortier commented on July 20, 2024

I see that there is an SPID in the config: src/tests/web3_tests/principal_test_config.json. Could it be related to this?

from enigma-core.

elichai avatar elichai commented on July 20, 2024

Nope, It's something to do with your report/quote.
You can try printing it before the panic, add a print of the report string here /root/src/enigma-tools-u/src/attestation_service/service.rs:143

from enigma-core.

Isan-Rivkin avatar Isan-Rivkin commented on July 20, 2024

@fredfortier could you cd into enigma-tools-u and run cargo test see if attestation_service passes?

from enigma-core.

fredfortier avatar fredfortier commented on July 20, 2024

Yes, these passed fine.

running 9 tests
test tests::it_works ... ok
test attestation_service::service::test::test_decoding_quote ... ok
test attestation_service::service::test::test_verify_report ... ok
test web3_utils::w3utils::test::test_deployed_contract ... ok
test web3_utils::w3utils::test::test_deploy_dummy_contract ... ok
test web3_utils::w3utils::test::test_deploy_enigma_contract ... ok
test attestation_service::service::test::test_get_response_attestation_service ... ok
test attestation_service::service::test::test_get_response_attestation_service_rlp_encoded ... ok
test attestation_service::service::test::test_attestation_service_decode_and_verify ... ok

test result: ok. 9 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

   Doc-tests enigma-tools-u

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

from enigma-core.

fredfortier avatar fredfortier commented on July 20, 2024

@elichai Here is the report from the report_str in line 143.

the report: {"id":"211334902280103414951190244552672986386","timestamp":"2018-12-03T19:24:02.462561","isvEnclaveQuoteStatus":"OK","isvEnclaveQuoteBody":"AgAAAPIKAAAHAAYAAAAAABYB+Vw5ueowf+qruQGtw+42Dl1EiXFRl1DnB1bGTVkKCAgCBAECAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAAAAAAHAAAAAAAAAMYXJwG+NAooXjNU08HSVxCZiQMqJC7KgJPx8+gKR34lAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACD1xnnferKFHD2uvYqTXdDA8iZ22kCD5xw7h38CMfOngAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAweDFkMDkxYzU5MjU3YzljYjk1NTIyZmM0MTU2MzQxMTI1MWY3YzUyYjYAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}
thread 'boot_network::principal_manager::test::test_full_principal_logic' panicked at 'called `Result::unwrap()` on an `Err` value: Error("missing field `platformInfoBlob`", line: 1, column: 719)', libcore/result.rs:1009:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at libstd/sys_common/backtrace.rs:71
             at libstd/sys_common/backtrace.rs:59
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:211
   3: std::panicking::default_hook
             at libstd/panicking.rs:227
   4: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:476
   5: std::panicking::continue_panic_fmt
             at libstd/panicking.rs:390

The error suggest that it's missing the field platformInfoBlob. This makes sense because it's not in my report but it is in the ASResult struct. Somehow my SGX driver behaves differently. I'm not sure if this an attribute that's always supposed to be in the report or only for some platforms. Now that I understand the root cause, I can work around it.

from enigma-core.

fredfortier avatar fredfortier commented on July 20, 2024

I modified src/attestation_service/service.rs:21 to:

#[derive(Serialize, Deserialize, Debug)]
pub struct ASReport {
    pub id: String,
    pub timestamp: String,
    pub isvEnclaveQuoteStatus: String,
    pub platformInfoBlob: Option<String>, // Made optional
    pub isvEnclaveQuoteBody: String,
}

I'll let you guys decide if this is an appropriate resolution, but it fixes my issue for now. The principal node is now behaving as advertised.

from enigma-core.

Isan-Rivkin avatar Isan-Rivkin commented on July 20, 2024

Good idea, apparently platformInfoBlob is optional in Intel's API

from enigma-core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.