diff --git a/scripts/test_algorithm.sh b/scripts/test_algorithm.sh index 14b04b2..fb6ebf2 100644 --- a/scripts/test_algorithm.sh +++ b/scripts/test_algorithm.sh @@ -76,6 +76,12 @@ if ! is_positive_integer "$num_workers"; then echo "Error: Number of workers must be a positive integer." exit 1 fi +read -p "Enter max fuel (default is 10000000000): " max_fuel +max_fuel=${max_fuel:-1} +if ! is_positive_integer "$max_fuel"; then + echo "Error: Max fuel must be a positive integer." + exit 1 +fi read -p "Enable debug mode? (leave blank to disable) " enable_debug if [[ -n $enable_debug ]]; then debug_mode=true @@ -117,7 +123,7 @@ while [ $remaining_nonces -gt 0 ]; do start_time=$(date +%s%3N) stdout=$(mktemp) stderr=$(mktemp) - ./target/release/tig-worker compute_batch "$SETTINGS" "random_string" $current_nonce $nonces_to_compute $power_of_2_nonces $REPO_DIR/tig-algorithms/wasm/$CHALLENGE/$ALGORITHM.wasm --workers $nonces_to_compute >"$stdout" 2>"$stderr" + ./target/release/tig-worker compute_batch "$SETTINGS" "random_string" $current_nonce $nonces_to_compute $power_of_2_nonces $REPO_DIR/tig-algorithms/wasm/$CHALLENGE/$ALGORITHM.wasm --workers $nonces_to_compute --fuel $max_fuel >"$stdout" 2>"$stderr" exit_code=$? output_stdout=$(cat "$stdout") output_stderr=$(cat "$stderr") diff --git a/tig-worker/src/main.rs b/tig-worker/src/main.rs index 260ad47..e2bea8b 100644 --- a/tig-worker/src/main.rs +++ b/tig-worker/src/main.rs @@ -28,7 +28,7 @@ fn cli() -> Command { .arg(arg!( "Path to a wasm file").value_parser(clap::value_parser!(PathBuf))) .arg( arg!(--fuel [FUEL] "Optional maximum fuel parameter for WASM VM") - .default_value("2000000000") + .default_value("10000000000") .value_parser(clap::value_parser!(u64)), ) .arg(