From 90357eeae1085ea9507b8d4abb669a8c3c0a9bef Mon Sep 17 00:00:00 2001 From: pwang200 <354723+pwang200@users.noreply.github.com> Date: Thu, 14 May 2026 18:53:29 -0400 Subject: [PATCH] bump get_nft host function cost from 1000 to 5000 (#7200) --- src/libxrpl/tx/wasm/WasmVM.cpp | 2 +- src/test/app/Wasm_test.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libxrpl/tx/wasm/WasmVM.cpp b/src/libxrpl/tx/wasm/WasmVM.cpp index 2a2627753f..f3a12d0fb9 100644 --- a/src/libxrpl/tx/wasm/WasmVM.cpp +++ b/src/libxrpl/tx/wasm/WasmVM.cpp @@ -61,7 +61,7 @@ setCommonHostFunctions(HostFunctions* hfs, ImportVec& i) WASM_IMPORT_FUNC2(i, ticketKeylet, "ticket_keylet", hfs, 350); WASM_IMPORT_FUNC2(i, vaultKeylet, "vault_keylet", hfs, 350); - WASM_IMPORT_FUNC2(i, getNFT, "get_nft", hfs, 1000); + WASM_IMPORT_FUNC2(i, getNFT, "get_nft", hfs, 5'000); WASM_IMPORT_FUNC2(i, getNFTIssuer, "get_nft_issuer", hfs, 70); WASM_IMPORT_FUNC2(i, getNFTTaxon, "get_nft_taxon", hfs, 60); WASM_IMPORT_FUNC2(i, getNFTFlags, "get_nft_flags", hfs, 60); diff --git a/src/test/app/Wasm_test.cpp b/src/test/app/Wasm_test.cpp index 1582c2c809..1140de9293 100644 --- a/src/test/app/Wasm_test.cpp +++ b/src/test/app/Wasm_test.cpp @@ -396,7 +396,7 @@ struct Wasm_test : public beast::unit_test::suite auto re = engine.run( allHostFuncWasm, hfs, 1'000'000, ESCROW_FUNCTION_NAME, {}, imp, env.journal); - checkResult(re, 1, 66'340); + checkResult(re, 1, 70'340); env.close(); } @@ -435,7 +435,7 @@ struct Wasm_test : public beast::unit_test::suite { TestHostFunctions hfs(env, 0); auto re = runEscrowWasm(allHFWasm, hfs, 100'000, ESCROW_FUNCTION_NAME, {}); - checkResult(re, 1, 66'340); + checkResult(re, 1, 70'340); } { @@ -459,7 +459,7 @@ struct Wasm_test : public beast::unit_test::suite TestHostFunctions hfs(env, 0); auto re = runEscrowWasm( allHFWasm, hfs, std::numeric_limits::max(), ESCROW_FUNCTION_NAME, {}); - checkResult(re, 1, 66'340); + checkResult(re, 1, 70'340); } { // fail because trying to access nonexistent field @@ -628,7 +628,7 @@ struct Wasm_test : public beast::unit_test::suite auto const codecovWasm = hexToBytes(codecovTestsWasmHex); TestHostFunctions hfs(env, 0); - auto const allowance = 208'169; + auto const allowance = 220'169; auto re = runEscrowWasm(codecovWasm, hfs, allowance, ESCROW_FUNCTION_NAME, {}); checkResult(re, 1, allowance);