I am unable to submit transactions to local node

I haven’t been able to submit transactions through my local node. Wondering if this is not supported or if its a bug.

Rust SDK error:

Provider(
    "io error: Decode error: Custom { kind: Other, error: \"Response errors; Transaction collided: Transaction with the same UTXO (id: dc62fb......etc) already exists and is more worth it\" }",

Fuel-Core:

2025-02-11T19:41:19.432202Z  INFO fuel_core_txpool::update_sender: 82: Transaction 585ac4b7f95e550a24a4699f52690af714f938e56c139f40bf6dfe5bfe00cdde squeezed out because Transaction collided: Transaction with the same UTXO (id: dc62fb.....etc) already exists and is more worth it

this is my active toolchain, although I’ve encountered this issue since the launch of fuel, so not sure if its relevant:

active toolchain
----------------
nightly-x86_64-unknown-linux-gnu (default)
  forc : 0.66.5+nightly.20250113.e40ebf4157
    - forc-client
      - forc-deploy : 0.66.5+nightly.20250113.e40ebf4157
      - forc-run : 0.66.5+nightly.20250113.e40ebf4157
    - forc-crypto : 0.66.5+nightly.20250113.e40ebf4157
    - forc-debug : 0.66.5+nightly.20250113.e40ebf4157
    - forc-doc : 0.66.5+nightly.20250113.e40ebf4157
    - forc-fmt : 0.66.5+nightly.20250113.e40ebf4157
    - forc-lsp : 0.66.5+nightly.20250113.e40ebf4157
    - forc-tx : 0.66.5+nightly.20250113.e40ebf4157
    - forc-wallet : 0.11.1+nightly.20250113.f6f0ff07c8
  fuel-core : 0.40.2+nightly.20250113.bc91cb5d5b
  fuel-core-keygen : not found
1 Like

Hey @soltheon, could you please share your code to look at?

2 Likes

Hey @soltheon, could you please share your code to look at?

It looks like your transaction is being squeezed out of the mempool because it conflicts with another transaction offering a higher fee or tip. In other words, if you’re creating multiple transactions that spend the same coins, the network will prioritize the more valuable one. You might want to look up the conflicting transaction ID and compare the two transactions.

2 Likes

Yea of course I read the error message. My problem is the transaction never gets pushed to the sequencer. It just stays in my local mempool, so when i try another transaction it returns that error.

This is the recent code, but I have tried many different transactions and they all have the same issue. I have tried updating and using different versions of fuel-core and fuels-rs as well.

It only works when I instantiate all contracts and wallet providers with the “mainnet.fuel.network” node. Right now I am using my local node only for read only and simulations. Which is fine, but it’s a bit messy having to reinitialize everything with a different provider before actually sending the call.

    let mut call_mainnet = script_mainnet
        .main(
            amount_in,
            amount_out_min,
            pools,
            path,
            amounts_out_formatted.0,
            amounts_out_formatted.1,
            recipient.into(),
            deadline,
        )
        .with_tx_policies(tx_policies)
        .with_contracts(
            mainnet_dependencies
                .iter()
                .map(|contract| contract as &dyn ContractDependency)
                .chain([
                    &mira_amm_mainnet as &dyn ContractDependency,
                    &helper_mainnet as &dyn ContractDependency,
                ])
                .collect::<Vec<&dyn ContractDependency>>()
                .as_slice(),
        )
        .with_inputs(inputs)
        .with_outputs(outputs)
        .with_variable_output_policy(VariableOutputPolicy::EstimateMinimum);

    match call_mainnet.call().await {
        Ok(_) => {
            tracing::info!(
                "successfully swapped {:?} for {:?}  :-)",
                amount_in,
                amount_out_min
            );
        }
        Err(e) => {
            dbg!(&e);
            return Err(anyhow::anyhow!(format!("{:?}", e)));
        }
    }
1 Like

Hi again!
It would be really helpful if you could share the repo so I can reproduce the issue and analyze it on my end. I’ll also be discussing this with the core team to see if we can find a solution together.

1 Like

Its not a public repo unfortunately – I verified that a basic transfer of ETH works properly with the local node, but this code specifically doesn’t.

Have others had success submitting complex scripts through local nodes?

Anyways I will try to run it through a local build of fuel-core with debugging on to see what is going on.

1 Like

Ahh I get this error trying to run fuel_core on master branch:
Error: cannot initialize queries with non-default costs in tests

1 Like

This seems to be fixed after upgrading fuels-rs to 0.71.0 and fuels-core to 0.41.7