I am using determine_missing_contracts
in places of my application where I do not have access to the contract ids used for the nested calls within my contract.
If I isolate this code which is causing this issue and do the only call which is executed from within the call flow, it is successful and then, when trying to perform the function call (which calls the previous function from within) right after, it yields an error.
The transaction logs can be seen here
CallResponse { value: true, receipts: [Call { id: 0000000000000000000000000000000000000000000000000000000000000000, to: f9323d8fc4b5df20687efc24ae81e4037408758eb2db57f0f6cb9da7bb3c41c4, amount: 0, asset_id: f8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07, gas: 77392, param1: 10480, param2: 10494, pc: 11920, is: 11920 }, ReturnData { id: f9323d8fc4b5df20687efc24ae81e4037408758eb2db57f0f6cb9da7bb3c41c4, ptr: 67091165, len: 1, digest: 4bf5122f344554c53bde2ebb8cd2b7e3d1600ad631c385a5d7cce23c7785459a, pc: 16468, is: 11920, data: Some(01) }, Return { id: 0000000000000000000000000000000000000000000000000000000000000000, val: 1, pc: 10388, is: 10368 }, ScriptResult { result: Success, gas_used: 82912 }], gas_used: 82912, log_decoder: LogDecoder { log_formatters: {LogId(f9323d8fc4b5df20687efc24ae81e4037408758eb2db57f0f6cb9da7bb3c41c4, "12857203263801679462"): LogFormatter { type_id: TypeId { t: (1069581086878444301, 2153821500543228854) } }}, decoder_config: DecoderConfig { max_depth: 45, max_tokens: 10000 } }, tx_id: Some(fbbfd50bf61852458e3c3cb03bf283fb9c9aead5c973c726edb22877c22dd288) }
`Err` value: Transaction(Reverted { reason: "failed to decode log from require revert: codec: missing log formatter for log_id: `LogId(f9323d8fc4b5df20687efc24ae81e4037408758eb2db57f0f6cb9da7bb3c41c4, \"12857203263801679462\")`, data: `[0, 0, 0, 0, 0, 0, 0, 1]`. Consider adding external contracts using `with_contracts()`", revert_id: 18446744073709486080
As we can see, the Log ID of the first successful call and the second one which fails is matching, even though I am using determine_missing_contracts(Some(30))
for the second call, which should successfully figure out the internal calls.
On a side note, the contract within the failing function call is dynamic, I’ve tried to use different contracts and it seems to work, and doesn’t work for a specific contract (even though the contract works fine and does not revert during the call).
The latest fuels
SDK and Fuel Toolchain versions are used.