FuelLabs / fuel-indexer

🗃 The Fuel indexer is a standalone service that can be used to index various components of the Fuel blockchain.
https://docs.fuel.network/docs/indexer/
140 stars 66 forks source link

bugfix: fix find_many api server stub #1506

Closed lostman closed 7 months ago

lostman commented 7 months ago

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