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

Commit

Permalink
Merge branch 'develop' into sarah/spell-check
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahschwartz authored Dec 7, 2023
2 parents 3056af7 + dcc243b commit 6acf693
Show file tree
Hide file tree
Showing 9 changed files with 479 additions and 305 deletions.
720 changes: 438 additions & 282 deletions Cargo.lock

Large diffs are not rendered by default.

34 changes: 17 additions & 17 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,29 +61,29 @@ homepage = "https://fuel.network/"
license = "Apache-2.0"
repository = "https://github.com/FuelLabs/fuel-indexer"
rust-version = "1.73.0"
version = "0.24.1"
version = "0.24.2"

[workspace.dependencies]
async-graphql-parser = "5.0"
async-graphql-value = "5.0"
bincode = "1.3"
clap = "3.1"
forc-index = { version = "0.24.1", path = "./plugins/forc-index" }
forc-postgres = { version = "0.24.1", path = "./plugins/forc-postgres" }
fuel-indexer = { version = "0.24.1", path = "./packages/fuel-indexer" }
fuel-indexer-api-server = { version = "0.24.1", path = "./packages/fuel-indexer-api-server" }
fuel-indexer-database = { version = "0.24.1", path = "./packages/fuel-indexer-database" }
fuel-indexer-database-types = { version = "0.24.1", path = "./packages/fuel-indexer-database/database-types" }
fuel-indexer-graphql = { version = "0.24.1", path = "./packages/fuel-indexer-graphql" }
fuel-indexer-lib = { version = "0.24.1", path = "./packages/fuel-indexer-lib" }
fuel-indexer-macro-utils = { version = "0.24.1", path = "./packages/fuel-indexer-macros/macro-utils" }
fuel-indexer-macros = { version = "0.24.1", path = "./packages/fuel-indexer-macros", default-features = false }
fuel-indexer-metrics = { version = "0.24.1", path = "./packages/fuel-indexer-metrics" }
fuel-indexer-plugin = { version = "0.24.1", path = "./packages/fuel-indexer-plugin", default-features = false }
fuel-indexer-postgres = { version = "0.24.1", path = "./packages/fuel-indexer-database/postgres" }
fuel-indexer-schema = { version = "0.24.1", path = "./packages/fuel-indexer-schema", default-features = false }
fuel-indexer-types = { version = "0.24.1", path = "./packages/fuel-indexer-types" }
fuel-indexer-utils = { version = "0.24.1", path = "./packages/fuel-indexer-utils" }
forc-index = { version = "0.24.2", path = "./plugins/forc-index" }
forc-postgres = { version = "0.24.2", path = "./plugins/forc-postgres" }
fuel-indexer = { version = "0.24.2", path = "./packages/fuel-indexer" }
fuel-indexer-api-server = { version = "0.24.2", path = "./packages/fuel-indexer-api-server" }
fuel-indexer-database = { version = "0.24.2", path = "./packages/fuel-indexer-database" }
fuel-indexer-database-types = { version = "0.24.2", path = "./packages/fuel-indexer-database/database-types" }
fuel-indexer-graphql = { version = "0.24.2", path = "./packages/fuel-indexer-graphql" }
fuel-indexer-lib = { version = "0.24.2", path = "./packages/fuel-indexer-lib" }
fuel-indexer-macro-utils = { version = "0.24.2", path = "./packages/fuel-indexer-macros/macro-utils" }
fuel-indexer-macros = { version = "0.24.2", path = "./packages/fuel-indexer-macros", default-features = false }
fuel-indexer-metrics = { version = "0.24.2", path = "./packages/fuel-indexer-metrics" }
fuel-indexer-plugin = { version = "0.24.2", path = "./packages/fuel-indexer-plugin", default-features = false }
fuel-indexer-postgres = { version = "0.24.2", path = "./packages/fuel-indexer-database/postgres" }
fuel-indexer-schema = { version = "0.24.2", path = "./packages/fuel-indexer-schema", default-features = false }
fuel-indexer-types = { version = "0.24.2", path = "./packages/fuel-indexer-types" }
fuel-indexer-utils = { version = "0.24.2", path = "./packages/fuel-indexer-utils" }
fuel-tx = { version = "=0.35.4", default-features = false }
fuel-types = { version = "=0.35.4", default-features = false, features = ["serde"] }
fuel-vm = { version = "=0.35.4", default-features = false }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ spec:
- "--replace-indexer"
- "--accept-sql-queries"
- "--block-page-size"
- "10"
- "50"
- "--client-request-delay"
- "1"
env:
- name: POSTGRES_PASSWORD
valueFrom:
Expand Down
4 changes: 3 additions & 1 deletion helm/fuel-indexer/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ spec:
- "--replace-indexer"
- "--accept-sql-queries"
- "--block-page-size"
- "10"
- "50"
- "--client-request-delay"
- "1"
envFrom:
- configMapRef:
name: fuel-indexer
Expand Down
4 changes: 2 additions & 2 deletions packages/fuel-indexer-api-server/src/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use wasmer::{

/// Extract the `TOOLCHAIN_VERSION` string from a WASM module. This function
/// creates a `wasmer::Instance` in order to do this.
pub(crate) fn check_wasm_toolchain_version(data: Vec<u8>) -> anyhow::Result<String> {
pub fn check_wasm_toolchain_version(data: Vec<u8>) -> anyhow::Result<String> {
let mut store = wasmer::Store::default();

let module = wasmer::Module::new(&store, data.clone())?;
Expand All @@ -20,7 +20,7 @@ pub(crate) fn check_wasm_toolchain_version(data: Vec<u8>) -> anyhow::Result<Stri
);
exports.insert(
"ff_find_many".to_string(),
Function::new_typed(&mut store, |_: i64, _: i64, _: i32, _: i32| 0i32),
Function::new_typed(&mut store, |_: i64, _: i32, _: i32| 0i32),
);
exports.insert(
"ff_early_exit".to_string(),
Expand Down
2 changes: 2 additions & 0 deletions packages/fuel-indexer-api-server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ pub(crate) mod sql;
mod uses;

pub mod utils {
pub use crate::ffi::check_wasm_toolchain_version;

use axum::body::Body;
use http::Request;

Expand Down
4 changes: 4 additions & 0 deletions packages/fuel-indexer-benchmarks/src/bin/qa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,10 @@ async fn main() {
.arg(&postgres_user)
.arg("--postgres-database")
.arg(&postgres_db)
.arg("--client-request-delay")
.arg("1")
.arg("--block-page-size")
.arg("50")
.spawn()
.unwrap();

Expand Down
10 changes: 9 additions & 1 deletion packages/fuel-indexer-tests/tests/web_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use fuel_indexer_lib::config::{
};
use fuel_indexer_postgres as postgres;
use fuel_indexer_tests::{
assets,
assets::{self, SIMPLE_WASM_WASM},
fixtures::{setup_web_test_components, WebTestComponents},
};
use hyper::header::CONTENT_TYPE;
Expand Down Expand Up @@ -408,3 +408,11 @@ async fn test_replacing_an_indexer_and_keeping_or_removing_data() {

assert_eq!(last, 5);
}

#[actix_web::test]
async fn test_check_toolchain_version() {
fuel_indexer_api_server::utils::check_wasm_toolchain_version(
SIMPLE_WASM_WASM.to_vec(),
)
.expect("failed to extract toolchain version from WASM module");
}
2 changes: 1 addition & 1 deletion scripts/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ services:
start_period: 80s
fuel-indexer:
image: ghcr.io/fuellabs/fuel-indexer:latest
command: bash -c "sleep 2 && ./fuel-indexer run --network beta-4 --postgres-host postgres --postgres-password postgres --web-api-host 0.0.0.0 --run-migrations"
command: bash -c "sleep 2 && ./fuel-indexer run --network beta-4 --postgres-host postgres --postgres-password postgres --web-api-host 0.0.0.0 --run-migrations --client-request-delay 1 --block-page-size 50"
ports:
- "29987:29987"
volumes:
Expand Down

0 comments on commit 6acf693

Please sign in to comment.