Unknown field error during Provider::connect to beta-3 on fuels v0.42

Hi there
I have created a brand new Sway project using latest version of fuels v0.42 by this command:

forc new counter-contract

And a test environment using:

cargo generate --init fuellabs/sway templates/sway-test-rs --name counter-contract

I wrote a simple contract, deployed the contract, and added a test which connected to the beta-3 testnet network and called a function from the contract. However, on the provider connection line, I encountered the following error:

running 1 test
thread 'do_increment' panicked at 'called `Result::unwrap()` on an `Err` value: IOError(Custom { kind: Other, error: "Response errors; Unknown field \"messageReceiptCount\" on type \"Header\".; Unknown field \"messageReceiptRoot\" on type \"Header\".; Unknown field \"chainId\" on type \"ConsensusParameters\"." })', tests/harness.rs:18:67
stack backtrace:
   0: rust_begin_unwind
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:579:5
   1: core::panicking::panic_fmt
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/panicking.rs:64:14
   2: core::result::unwrap_failed
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/result.rs:1750:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/result.rs:1090:23
   4: integration_tests::do_increment::{{closure}}
             at ./tests/harness.rs:18:20
   5: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/future/future.rs:125:9
   6: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/future/future.rs:125:9
   7: tokio::runtime::scheduler::current_thread::CoreGuard::block_on::{{closure}}::{{closure}}::{{closure}}
             at /Users/alexey/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.28.2/src/runtime/scheduler/current_thread.rs:541:57
   8: tokio::runtime::coop::with_budget
             at /Users/alexey/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.28.2/src/runtime/coop.rs:107:5
   9: tokio::runtime::coop::budget
             at /Users/alexey/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.28.

2/src/runtime/coop.rs:73:5
  10: tokio::runtime::scheduler::current_thread::CoreGuard::block_on::{{closure}}::{{closure}}
             at /Users/alexey/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.28.2/src/runtime/scheduler/current_thread.rs:541:25
  11: tokio::runtime::scheduler::current_thread::Context::enter
             at /Users/alexey/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.28.2/src/runtime/scheduler/current_thread.rs:350:19
  12: tokio::runtime::scheduler::current_thread::CoreGuard::block_on::{{closure}}
             at /Users/alexey/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.28.2/src/runtime/scheduler/current_thread.rs:540:36
  13: tokio::runtime::scheduler::current_thread::CoreGuard::enter::{{closure}}
             at /Users/alexey/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.28.2/src/runtime/scheduler/current_thread.rs:615:57
  14: tokio::macros::scoped_tls::ScopedKey<T>::set
             at /Users/alexey/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.28.2/src/macros/scoped_tls.rs:61:9
  15: tokio::runtime::scheduler::current_thread::CoreGuard::enter
             at /Users/alexey/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.28.2/src/runtime/scheduler/current_thread.rs:615:27
  16: tokio::runtime::scheduler::current_thread::CoreGuard::block_on
             at /Users/alexey/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.28.2/src/runtime/scheduler/current_thread.rs:530:19
  17: tokio::runtime::scheduler::current_thread::CurrentThread::block_on
             at /Users/alexey/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.28.2/src/runtime/scheduler/current_thread.rs:154:24
  18: tokio::runtime::runtime::Runtime::block_on
             at /Users/alexey/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.28.2/src/runtime/runtime.rs:302:47
  19: integration_tests::do_increment
             at ./tests/harness.rs:28:5
  20: integration_tests::do_increment::{{closure}}
             at ./tests/harness.rs:16:25
  21: core::ops::function::FnOnce::call_once
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/ops/function.rs:250:5
  22: core::ops::function::FnOnce::call_once
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/ops/function.rs:250:5

note: Some details are omitted, run with `RUST_BACKTRACE=full
1 Like

You are using fuels v0.42, while beta-3 testnet expects fuels v0.39.

I took your repo, ran fuelup default beta-3 to switch to beta-3 toolchain, changed fuels version to 0.39 in your Cargo.toml, and cargo test passed. You can find my commit here.

Good, thanks
Btw is there any way to use fuels v0.42 on beta-3?

No, because fuels v0.42 uses fuel-core 0.18.1 which is not compatible with beta-3.

Ok, thanks now I totally understand :saluting_face:
Looking forward to new rust sdk version with beta-3 support