Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

bugfix: fix find_many api server stub #1506

Merged
merged 2 commits into from
Dec 7, 2023
Merged

Conversation

lostman
Copy link
Contributor

@lostman lostman commented Dec 7, 2023

Description

Fixes #1505.

The correct find_many extern signature can be found here:

https://github.com/FuelLabs/fuel-indexer/blob/fefbf2c1f8addb952bb78cb95f28ee2cee041d4e/packages/fuel-indexer-plugin/src/wasm.rs#L27C28-L27C72

Testing steps

Start fuel-indexer service and deploy an indexer:

cargo run -p fuel-indexer -- run --network beta-4 --replace-indexer
cargo run -p forc-index -- deploy --path examples/fuel-explorer/fuel-explorer/

On v0.24.2 it fails with an error:

2023-12-07T09:24:28.464335Z  WARN fuel_indexer_api_server::uses: 416: Failed to get WASM module toolchain version: Error while importing "env"."ff_find_many": incompatible import type. Expected Function(FunctionType { params: [I64, I32, I32], results: [I32] }) but received Function(FunctionType { params: [I64, I64, I32, I32], results: [I32] })
2023-12-07T09:24:28.464537Z ERROR fuel_indexer_api_server::api: 131: ApiError: ToolchainVersionMismatch { toolchain_version: "unknown", fuel_indexer_version: "0.24.2" }
2023-12-07T09:24:28.464547Z ERROR fuel_indexer_api_server::api: 182: 405 - WASM module toolchain version `unknown` does not match fuel-indexer version `0.24.2`
2023-12-07T09:24:28.464844Z  INFO tower_http::trace::on_response: 254: finished processing request latency=3139713 μs status=405
^C2023-12-07T09:26:20.304338Z  INFO fuel_indexer::commands::run: 33: Received SIGINT. Stopping services.

On this branch, deployment succeeds:

2023-12-07T09:26:59.100549Z  INFO fuel_indexer_postgres: 585: Registered Asset(Wasm) with Version(db5c7dff3f7fd28beb75392e6f337cfe2e056813986ab7634e543431a1e90e30) to Indexer(fuellabs.explorer).
2023-12-07T09:26:59.102376Z  INFO tower_http::trace::on_response: 254: finished processing request latency=3544555 μs status=200
2023-12-07T09:26:59.118883Z  INFO fuel_indexer::service: 391: Resuming Indexer(fuellabs.explorer) from block 1
2023-12-07T09:27:04.988186Z  INFO fuel_indexer::database: 249: Database loading schema for Indexer(fuellabs.explorer) with Version(bca69dba935a24f511cef34298b2e1e6e8637c29244b208458c3b73ca6088be3).
2023-12-07T09:27:05.023166Z  INFO fuel_indexer::executor: 111: Indexer(fuellabs.explorer) subscribing to Fuel node at beta-4.fuel.network:80
2023-12-07T09:27:05.027385Z  WARN fuel_indexer::executor: 119: No end_block specified in the manifest. Indexer(fuellabs.explorer) will run forever.

Changelog

  • Fixed find_many stub in the API server
  • Added a test case to prevent this type of errors in the future.

@lostman lostman self-assigned this Dec 7, 2023
@lostman lostman marked this pull request as ready for review December 7, 2023 16:23
Copy link
Contributor

@ra0x3 ra0x3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@ra0x3 ra0x3 merged commit dcc243b into develop Dec 7, 2023
19 checks passed
@ra0x3 ra0x3 deleted the maciej/1505-bugfix-find_many branch December 7, 2023 16:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: indexers fail due to incorrect instantiation of stubs in the API server.
3 participants