add tests for set_state_cache

This commit is contained in:
tequ
2025-03-30 20:56:06 +09:00
parent 272129abd1
commit 3e0c8ddc61
4 changed files with 293 additions and 34 deletions

View File

@@ -1495,6 +1495,7 @@ set_state_cache(
if (stateMap.find(acc) == stateMap.end())
{
// new Account Key
// if this is the first time this account has been interacted with
// we will compute how many available reserve positions there are
auto const& fees = hookCtx.applyCtx.view().fees();
@@ -1551,6 +1552,7 @@ set_state_cache(
if (stateMapAcc.find(ns) == stateMapAcc.end())
{
// new Namespace Key
if (modified)
{
if (!canReserveNew)
@@ -1580,6 +1582,7 @@ set_state_cache(
auto& stateMapNs = stateMapAcc[ns];
if (stateMapNs.find(key) == stateMapNs.end())
{
// new State Key
if (modified)
{
if (!canReserveNew)
@@ -1593,11 +1596,12 @@ set_state_cache(
return 1;
}
// existing State Key
auto const newReserve = hook::computeHookStateReserves(data);
auto const oldReserve =
hook::computeHookStateReserves(stateMapNs[key].second);
bool const canReserveUpdate =
availableForReserves >= hook::computeHookStateReserves(data);
bool const canReserveUpdate = newReserve <= oldReserve ||
availableForReserves >= newReserve - oldReserve;
if (modified)
{
@@ -1607,8 +1611,7 @@ set_state_cache(
if (!stateMapNs[key].first)
hookCtx.result.changedStateCount++;
if (view.rules().enabled(featureExtendedHookState) &&
newReserve > oldReserve)
if (view.rules().enabled(featureExtendedHookState))
availableForReserves -= newReserve - oldReserve;
stateMap.modified_entry_count++;

View File

@@ -74,7 +74,7 @@ namespace detail {
// Feature.cpp. Because it's only used to reserve storage, and determine how
// large to make the FeatureBitset, it MAY be larger. It MUST NOT be less than
// the actual number of amendments. A LogicError on startup will verify this.
static constexpr std::size_t numFeatures = 78;
static constexpr std::size_t numFeatures = 79;
/** Amendments that this server supports and the default voting behavior.
Whether they are enabled depends on the Rules defined in the validated

View File

@@ -9656,11 +9656,18 @@ public:
BEAST_EXPECT((*env.le("frank"))[sfOwnerCount] == 260);
}
auto const hookSizeParam = [&](const std::string& str) {
Json::Value params{Json::arrayValue};
params[0U][jss::HookParameter][jss::HookParameterName] =
strHex(std::string("SIZE"));
params[0U][jss::HookParameter][jss::HookParameterValue] = str;
return params;
};
// Extended hook state reserve
{
bool extHookStateEnabled = features[featureExtendedHookState];
TestHook hook = wasm[R"[test.hook](
TestHook extended_state_hook = wasm[R"[test.hook](
#include <stdint.h>
extern int32_t _g (uint32_t id, uint32_t maxiter);
extern int64_t accept (uint32_t read_ptr, uint32_t read_len, int64_t error_code);
@@ -9691,7 +9698,11 @@ public:
)[test.hook]"];
// install the hook on gary
env(ripple::test::jtx::hook(gary, {{hso(hook, overrideFlag)}}, 0),
Json::Value jv = hso(extended_state_hook, overrideFlag);
jv[jss::HookOn] =
"fffffffffffffffffffffffffffffffffffffff7ffffffffffffffffffbfff"
"ff"; // only invoke high
env(ripple::test::jtx::hook(gary, {{jv}}, 0),
M("set state_set 14"),
HSFEE);
env.close();
@@ -9699,14 +9710,6 @@ public:
BEAST_EXPECT((*env.le("gary"))[sfOwnerCount] == 1);
BEAST_EXPECT(!env.le("gary")->isFieldPresent(sfHookStateCount));
auto const hookSizeParam = [&](const std::string& str) {
Json::Value params{Json::arrayValue};
params[0U][jss::HookParameter][jss::HookParameterName] =
strHex(std::string("SIZE"));
params[0U][jss::HookParameter][jss::HookParameterValue] = str;
return params;
};
// create new state
Json::Value invokeJv1 = invoke::invoke(gary);
invokeJv1[jss::HookParameters] = hookSizeParam(
@@ -9755,6 +9758,90 @@ public:
else
BEAST_EXPECT((*env.le("gary"))[sfHookStateCount] == 0);
}
{
bool extHookStateEnabled = features[featureExtendedHookState];
// tests for set_state_cache
if (extHookStateEnabled)
{
TestHook extended_state_reserve_hook = wasm[R"[test.hook](
#include <stdint.h>
extern int32_t _g (uint32_t id, uint32_t maxiter);
extern int64_t accept (uint32_t read_ptr, uint32_t read_len, int64_t error_code);
extern int64_t rollback (uint32_t read_ptr, uint32_t read_len, int64_t error_code);
extern int64_t state_set (
uint32_t read_ptr,
uint32_t read_len,
uint32_t kread_ptr,
uint32_t kread_len
);
extern int64_t state_foreign_set (
uint32_t read_ptr,
uint32_t read_len,
uint32_t kread_ptr,
uint32_t kread_len,
uint32_t nread_ptr,
uint32_t nread_len,
uint32_t aread_ptr,
uint32_t aread_len
);
extern int64_t otxn_param(uint32_t, uint32_t, uint32_t, uint32_t);
#define RESERVE_INSUFFICIENT -38
#define ASSERT(x)\
if (!(x))\
rollback((uint32_t)#x, sizeof(#x), __LINE__);
#define ASSERT_EQUAL(x, y)\
if (!(x == y))\
rollback((uint32_t)#x, sizeof(#x), x);
int64_t hook(uint32_t reserved)
{
_g(1,1);
{
uint16_t size;
ASSERT(otxn_param(&size, 2, "SIZE", 4) > 0);
// 1. first account for StateMap
ASSERT_EQUAL(state_set(0, size, "1", 1), RESERVE_INSUFFICIENT);
ASSERT(state_set("1" ,1, "1", 1) > 0);
// 2. first namespace for StateMap
ASSERT_EQUAL(state_foreign_set(0, size, "1", 1, "1", 32, 0, 0), RESERVE_INSUFFICIENT);
ASSERT(state_foreign_set("1" ,1, "1", 1, "1", 32, 0, 0) > 0);
// 3. first statekey for StateMap
ASSERT_EQUAL(state_set(0, size, "2", 1), RESERVE_INSUFFICIENT);
ASSERT(state_set("1" ,1, "2", 1) > 0);
// 4. existing statedata
ASSERT_EQUAL(state_set(0, size, "1", 1), RESERVE_INSUFFICIENT);
ASSERT_EQUAL(state_set(0, size-256*3, "1", 1), size-256*3);
}
accept(0,0,0);
}
)[test.hook]"];
// install the hook on gary
Json::Value jv = hso(extended_state_reserve_hook, overrideFlag);
jv[jss::HookOn] =
"fffffffffffffffffffffffffffffffffffffff7ffffffffffffffffff"
"bfff"
"ff"; // only invoke high
env(ripple::test::jtx::hook(gary, {{jv}}, 0), HSFEE);
env.close();
auto const caller = Account{"caller"};
env.fund(XRP(10000), caller);
env.close();
auto const payAmount = env.balance(gary) -
(env.current()->fees().accountReserve(1 + 8)) -
drops(1); // 8 + Hook
// reduce gary's balance
env(pay(gary, Account{"master"}, payAmount), fee(XRP(1)));
env.close();
// invoke the hook from alice
Json::Value invokeJv5 = invoke::invoke(caller, gary, "");
invokeJv5[jss::HookParameters] =
hookSizeParam("0008" /* 2048 */);
env(invokeJv5, M("test state_set 15"), fee(XRP(1)));
env.close();
}
}
// RH TODO:
// check state can be set on emit callback

View File

@@ -14901,6 +14901,175 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
}},
/* ==== WASM: 73 ==== */
{R"[test.hook](
#include <stdint.h>
extern int32_t _g (uint32_t id, uint32_t maxiter);
extern int64_t accept (uint32_t read_ptr, uint32_t read_len, int64_t error_code);
extern int64_t rollback (uint32_t read_ptr, uint32_t read_len, int64_t error_code);
extern int64_t state_set (
uint32_t read_ptr,
uint32_t read_len,
uint32_t kread_ptr,
uint32_t kread_len
);
extern int64_t state_foreign_set (
uint32_t read_ptr,
uint32_t read_len,
uint32_t kread_ptr,
uint32_t kread_len,
uint32_t nread_ptr,
uint32_t nread_len,
uint32_t aread_ptr,
uint32_t aread_len
);
extern int64_t otxn_param(uint32_t, uint32_t, uint32_t, uint32_t);
#define RESERVE_INSUFFICIENT -38
#define ASSERT(x)\
if (!(x))\
rollback((uint32_t)#x, sizeof(#x), __LINE__);
#define ASSERT_EQUAL(x, y)\
if (!(x == y))\
rollback((uint32_t)#x, sizeof(#x), x);
int64_t hook(uint32_t reserved)
{
_g(1,1);
{
uint16_t size;
ASSERT(otxn_param(&size, 2, "SIZE", 4) > 0);
// 1. first account for StateMap
ASSERT_EQUAL(state_set(0, size, "1", 1), RESERVE_INSUFFICIENT);
ASSERT(state_set("1" ,1, "1", 1) > 0);
// 2. first namespace for StateMap
ASSERT_EQUAL(state_foreign_set(0, size, "1", 1, "1", 32, 0, 0), RESERVE_INSUFFICIENT);
ASSERT(state_foreign_set("1" ,1, "1", 1, "1", 32, 0, 0) > 0);
// 3. first statekey for StateMap
ASSERT_EQUAL(state_set(0, size, "2", 1), RESERVE_INSUFFICIENT);
ASSERT(state_set("1" ,1, "2", 1) > 0);
// 4. existing statedata
ASSERT_EQUAL(state_set(0, size, "1", 1), RESERVE_INSUFFICIENT);
ASSERT_EQUAL(state_set(0, size-256*3, "1", 1), size-256*3);
}
accept(0,0,0);
}
)[test.hook]",
{
0x00U, 0x61U, 0x73U, 0x6DU, 0x01U, 0x00U, 0x00U, 0x00U, 0x01U, 0x27U,
0x05U, 0x60U, 0x02U, 0x7FU, 0x7FU, 0x01U, 0x7FU, 0x60U, 0x04U, 0x7FU,
0x7FU, 0x7FU, 0x7FU, 0x01U, 0x7EU, 0x60U, 0x03U, 0x7FU, 0x7FU, 0x7EU,
0x01U, 0x7EU, 0x60U, 0x08U, 0x7FU, 0x7FU, 0x7FU, 0x7FU, 0x7FU, 0x7FU,
0x7FU, 0x7FU, 0x01U, 0x7EU, 0x60U, 0x01U, 0x7FU, 0x01U, 0x7EU, 0x02U,
0x5FU, 0x06U, 0x03U, 0x65U, 0x6EU, 0x76U, 0x02U, 0x5FU, 0x67U, 0x00U,
0x00U, 0x03U, 0x65U, 0x6EU, 0x76U, 0x0AU, 0x6FU, 0x74U, 0x78U, 0x6EU,
0x5FU, 0x70U, 0x61U, 0x72U, 0x61U, 0x6DU, 0x00U, 0x01U, 0x03U, 0x65U,
0x6EU, 0x76U, 0x08U, 0x72U, 0x6FU, 0x6CU, 0x6CU, 0x62U, 0x61U, 0x63U,
0x6BU, 0x00U, 0x02U, 0x03U, 0x65U, 0x6EU, 0x76U, 0x09U, 0x73U, 0x74U,
0x61U, 0x74U, 0x65U, 0x5FU, 0x73U, 0x65U, 0x74U, 0x00U, 0x01U, 0x03U,
0x65U, 0x6EU, 0x76U, 0x11U, 0x73U, 0x74U, 0x61U, 0x74U, 0x65U, 0x5FU,
0x66U, 0x6FU, 0x72U, 0x65U, 0x69U, 0x67U, 0x6EU, 0x5FU, 0x73U, 0x65U,
0x74U, 0x00U, 0x03U, 0x03U, 0x65U, 0x6EU, 0x76U, 0x06U, 0x61U, 0x63U,
0x63U, 0x65U, 0x70U, 0x74U, 0x00U, 0x02U, 0x03U, 0x02U, 0x01U, 0x04U,
0x05U, 0x03U, 0x01U, 0x00U, 0x02U, 0x06U, 0x21U, 0x05U, 0x7FU, 0x01U,
0x41U, 0xB0U, 0x8AU, 0x04U, 0x0BU, 0x7FU, 0x00U, 0x41U, 0xA7U, 0x0AU,
0x0BU, 0x7FU, 0x00U, 0x41U, 0x80U, 0x08U, 0x0BU, 0x7FU, 0x00U, 0x41U,
0xB0U, 0x8AU, 0x04U, 0x0BU, 0x7FU, 0x00U, 0x41U, 0x80U, 0x08U, 0x0BU,
0x07U, 0x08U, 0x01U, 0x04U, 0x68U, 0x6FU, 0x6FU, 0x6BU, 0x00U, 0x06U,
0x0AU, 0xEFU, 0x84U, 0x00U, 0x01U, 0xEBU, 0x84U, 0x00U, 0x02U, 0x02U,
0x7FU, 0x01U, 0x7EU, 0x23U, 0x80U, 0x80U, 0x80U, 0x80U, 0x00U, 0x41U,
0x10U, 0x6BU, 0x22U, 0x01U, 0x24U, 0x80U, 0x80U, 0x80U, 0x80U, 0x00U,
0x41U, 0x01U, 0x41U, 0x01U, 0x10U, 0x80U, 0x80U, 0x80U, 0x80U, 0x00U,
0x1AU, 0x02U, 0x40U, 0x20U, 0x01U, 0x41U, 0x0EU, 0x6AU, 0x41U, 0x02U,
0x41U, 0x80U, 0x88U, 0x80U, 0x80U, 0x00U, 0x41U, 0x04U, 0x10U, 0x81U,
0x80U, 0x80U, 0x80U, 0x00U, 0x42U, 0x00U, 0x55U, 0x0DU, 0x00U, 0x41U,
0x85U, 0x88U, 0x80U, 0x80U, 0x00U, 0x41U, 0x24U, 0x42U, 0x23U, 0x10U,
0x82U, 0x80U, 0x80U, 0x80U, 0x00U, 0x1AU, 0x0BU, 0x02U, 0x40U, 0x41U,
0x00U, 0x20U, 0x01U, 0x2FU, 0x01U, 0x0EU, 0x41U, 0xA9U, 0x88U, 0x80U,
0x80U, 0x00U, 0x41U, 0x01U, 0x10U, 0x83U, 0x80U, 0x80U, 0x80U, 0x00U,
0x42U, 0x5AU, 0x51U, 0x0DU, 0x00U, 0x41U, 0xABU, 0x88U, 0x80U, 0x80U,
0x00U, 0x41U, 0x1BU, 0x41U, 0x00U, 0x20U, 0x01U, 0x2FU, 0x01U, 0x0EU,
0x41U, 0xA9U, 0x88U, 0x80U, 0x80U, 0x00U, 0x41U, 0x01U, 0x10U, 0x83U,
0x80U, 0x80U, 0x80U, 0x00U, 0x10U, 0x82U, 0x80U, 0x80U, 0x80U, 0x00U,
0x1AU, 0x0BU, 0x02U, 0x40U, 0x41U, 0xA9U, 0x88U, 0x80U, 0x80U, 0x00U,
0x41U, 0x01U, 0x41U, 0xA9U, 0x88U, 0x80U, 0x80U, 0x00U, 0x41U, 0x01U,
0x10U, 0x83U, 0x80U, 0x80U, 0x80U, 0x00U, 0x42U, 0x00U, 0x55U, 0x0DU,
0x00U, 0x41U, 0xC6U, 0x88U, 0x80U, 0x80U, 0x00U, 0x41U, 0x1EU, 0x42U,
0x26U, 0x10U, 0x82U, 0x80U, 0x80U, 0x80U, 0x00U, 0x1AU, 0x0BU, 0x02U,
0x40U, 0x41U, 0x00U, 0x20U, 0x01U, 0x2FU, 0x01U, 0x0EU, 0x41U, 0xA9U,
0x88U, 0x80U, 0x80U, 0x00U, 0x41U, 0x01U, 0x41U, 0xA9U, 0x88U, 0x80U,
0x80U, 0x00U, 0x41U, 0x20U, 0x41U, 0x00U, 0x41U, 0x00U, 0x10U, 0x84U,
0x80U, 0x80U, 0x80U, 0x00U, 0x42U, 0x5AU, 0x51U, 0x0DU, 0x00U, 0x41U,
0xE4U, 0x88U, 0x80U, 0x80U, 0x00U, 0x41U, 0x32U, 0x41U, 0x00U, 0x20U,
0x01U, 0x2FU, 0x01U, 0x0EU, 0x41U, 0xA9U, 0x88U, 0x80U, 0x80U, 0x00U,
0x41U, 0x01U, 0x41U, 0xA9U, 0x88U, 0x80U, 0x80U, 0x00U, 0x41U, 0x20U,
0x41U, 0x00U, 0x41U, 0x00U, 0x10U, 0x84U, 0x80U, 0x80U, 0x80U, 0x00U,
0x10U, 0x82U, 0x80U, 0x80U, 0x80U, 0x00U, 0x1AU, 0x0BU, 0x02U, 0x40U,
0x41U, 0xA9U, 0x88U, 0x80U, 0x80U, 0x00U, 0x41U, 0x01U, 0x41U, 0xA9U,
0x88U, 0x80U, 0x80U, 0x00U, 0x41U, 0x01U, 0x41U, 0xA9U, 0x88U, 0x80U,
0x80U, 0x00U, 0x41U, 0x20U, 0x41U, 0x00U, 0x41U, 0x00U, 0x10U, 0x84U,
0x80U, 0x80U, 0x80U, 0x00U, 0x42U, 0x00U, 0x55U, 0x0DU, 0x00U, 0x41U,
0x96U, 0x89U, 0x80U, 0x80U, 0x00U, 0x41U, 0x35U, 0x42U, 0x29U, 0x10U,
0x82U, 0x80U, 0x80U, 0x80U, 0x00U, 0x1AU, 0x0BU, 0x02U, 0x40U, 0x41U,
0x00U, 0x20U, 0x01U, 0x2FU, 0x01U, 0x0EU, 0x41U, 0xCBU, 0x89U, 0x80U,
0x80U, 0x00U, 0x41U, 0x01U, 0x10U, 0x83U, 0x80U, 0x80U, 0x80U, 0x00U,
0x42U, 0x5AU, 0x51U, 0x0DU, 0x00U, 0x41U, 0xCDU, 0x89U, 0x80U, 0x80U,
0x00U, 0x41U, 0x1BU, 0x41U, 0x00U, 0x20U, 0x01U, 0x2FU, 0x01U, 0x0EU,
0x41U, 0xCBU, 0x89U, 0x80U, 0x80U, 0x00U, 0x41U, 0x01U, 0x10U, 0x83U,
0x80U, 0x80U, 0x80U, 0x00U, 0x10U, 0x82U, 0x80U, 0x80U, 0x80U, 0x00U,
0x1AU, 0x0BU, 0x02U, 0x40U, 0x41U, 0xA9U, 0x88U, 0x80U, 0x80U, 0x00U,
0x41U, 0x01U, 0x41U, 0xCBU, 0x89U, 0x80U, 0x80U, 0x00U, 0x41U, 0x01U,
0x10U, 0x83U, 0x80U, 0x80U, 0x80U, 0x00U, 0x42U, 0x00U, 0x55U, 0x0DU,
0x00U, 0x41U, 0xE8U, 0x89U, 0x80U, 0x80U, 0x00U, 0x41U, 0x1EU, 0x42U,
0x2CU, 0x10U, 0x82U, 0x80U, 0x80U, 0x80U, 0x00U, 0x1AU, 0x0BU, 0x02U,
0x40U, 0x41U, 0x00U, 0x20U, 0x01U, 0x2FU, 0x01U, 0x0EU, 0x41U, 0xA9U,
0x88U, 0x80U, 0x80U, 0x00U, 0x41U, 0x01U, 0x10U, 0x83U, 0x80U, 0x80U,
0x80U, 0x00U, 0x42U, 0x5AU, 0x51U, 0x0DU, 0x00U, 0x41U, 0xABU, 0x88U,
0x80U, 0x80U, 0x00U, 0x41U, 0x1BU, 0x41U, 0x00U, 0x20U, 0x01U, 0x2FU,
0x01U, 0x0EU, 0x41U, 0xA9U, 0x88U, 0x80U, 0x80U, 0x00U, 0x41U, 0x01U,
0x10U, 0x83U, 0x80U, 0x80U, 0x80U, 0x00U, 0x10U, 0x82U, 0x80U, 0x80U,
0x80U, 0x00U, 0x1AU, 0x0BU, 0x02U, 0x40U, 0x41U, 0x00U, 0x20U, 0x01U,
0x2FU, 0x01U, 0x0EU, 0x41U, 0x80U, 0x7AU, 0x6AU, 0x41U, 0xA9U, 0x88U,
0x80U, 0x80U, 0x00U, 0x41U, 0x01U, 0x10U, 0x83U, 0x80U, 0x80U, 0x80U,
0x00U, 0x20U, 0x01U, 0x2FU, 0x01U, 0x0EU, 0x41U, 0x80U, 0x7AU, 0x6AU,
0x22U, 0x02U, 0xACU, 0x51U, 0x0DU, 0x00U, 0x41U, 0x86U, 0x8AU, 0x80U,
0x80U, 0x00U, 0x41U, 0x21U, 0x41U, 0x00U, 0x20U, 0x02U, 0x41U, 0xA9U,
0x88U, 0x80U, 0x80U, 0x00U, 0x41U, 0x01U, 0x10U, 0x83U, 0x80U, 0x80U,
0x80U, 0x00U, 0x10U, 0x82U, 0x80U, 0x80U, 0x80U, 0x00U, 0x1AU, 0x0BU,
0x41U, 0x00U, 0x41U, 0x00U, 0x42U, 0x00U, 0x10U, 0x85U, 0x80U, 0x80U,
0x80U, 0x00U, 0x1AU, 0x20U, 0x01U, 0x41U, 0x10U, 0x6AU, 0x24U, 0x80U,
0x80U, 0x80U, 0x80U, 0x00U, 0x20U, 0x03U, 0x0BU, 0x0BU, 0xAFU, 0x02U,
0x01U, 0x00U, 0x41U, 0x80U, 0x08U, 0x0BU, 0xA7U, 0x02U, 0x53U, 0x49U,
0x5AU, 0x45U, 0x00U, 0x6FU, 0x74U, 0x78U, 0x6EU, 0x5FU, 0x70U, 0x61U,
0x72U, 0x61U, 0x6DU, 0x28U, 0x26U, 0x73U, 0x69U, 0x7AU, 0x65U, 0x2CU,
0x20U, 0x32U, 0x2CU, 0x20U, 0x22U, 0x53U, 0x49U, 0x5AU, 0x45U, 0x22U,
0x2CU, 0x20U, 0x34U, 0x29U, 0x20U, 0x3EU, 0x20U, 0x30U, 0x00U, 0x31U,
0x00U, 0x73U, 0x74U, 0x61U, 0x74U, 0x65U, 0x5FU, 0x73U, 0x65U, 0x74U,
0x28U, 0x30U, 0x2CU, 0x20U, 0x73U, 0x69U, 0x7AU, 0x65U, 0x2CU, 0x20U,
0x22U, 0x31U, 0x22U, 0x2CU, 0x20U, 0x31U, 0x29U, 0x00U, 0x73U, 0x74U,
0x61U, 0x74U, 0x65U, 0x5FU, 0x73U, 0x65U, 0x74U, 0x28U, 0x22U, 0x31U,
0x22U, 0x20U, 0x2CU, 0x31U, 0x2CU, 0x20U, 0x22U, 0x31U, 0x22U, 0x2CU,
0x20U, 0x31U, 0x29U, 0x20U, 0x3EU, 0x20U, 0x30U, 0x00U, 0x73U, 0x74U,
0x61U, 0x74U, 0x65U, 0x5FU, 0x66U, 0x6FU, 0x72U, 0x65U, 0x69U, 0x67U,
0x6EU, 0x5FU, 0x73U, 0x65U, 0x74U, 0x28U, 0x30U, 0x2CU, 0x20U, 0x73U,
0x69U, 0x7AU, 0x65U, 0x2CU, 0x20U, 0x22U, 0x31U, 0x22U, 0x2CU, 0x20U,
0x31U, 0x2CU, 0x20U, 0x22U, 0x31U, 0x22U, 0x2CU, 0x20U, 0x33U, 0x32U,
0x2CU, 0x20U, 0x30U, 0x2CU, 0x20U, 0x30U, 0x29U, 0x00U, 0x73U, 0x74U,
0x61U, 0x74U, 0x65U, 0x5FU, 0x66U, 0x6FU, 0x72U, 0x65U, 0x69U, 0x67U,
0x6EU, 0x5FU, 0x73U, 0x65U, 0x74U, 0x28U, 0x22U, 0x31U, 0x22U, 0x20U,
0x2CU, 0x31U, 0x2CU, 0x20U, 0x22U, 0x31U, 0x22U, 0x2CU, 0x20U, 0x31U,
0x2CU, 0x20U, 0x22U, 0x31U, 0x22U, 0x2CU, 0x20U, 0x33U, 0x32U, 0x2CU,
0x20U, 0x30U, 0x2CU, 0x20U, 0x30U, 0x29U, 0x20U, 0x3EU, 0x20U, 0x30U,
0x00U, 0x32U, 0x00U, 0x73U, 0x74U, 0x61U, 0x74U, 0x65U, 0x5FU, 0x73U,
0x65U, 0x74U, 0x28U, 0x30U, 0x2CU, 0x20U, 0x73U, 0x69U, 0x7AU, 0x65U,
0x2CU, 0x20U, 0x22U, 0x32U, 0x22U, 0x2CU, 0x20U, 0x31U, 0x29U, 0x00U,
0x73U, 0x74U, 0x61U, 0x74U, 0x65U, 0x5FU, 0x73U, 0x65U, 0x74U, 0x28U,
0x22U, 0x31U, 0x22U, 0x20U, 0x2CU, 0x31U, 0x2CU, 0x20U, 0x22U, 0x32U,
0x22U, 0x2CU, 0x20U, 0x31U, 0x29U, 0x20U, 0x3EU, 0x20U, 0x30U, 0x00U,
0x73U, 0x74U, 0x61U, 0x74U, 0x65U, 0x5FU, 0x73U, 0x65U, 0x74U, 0x28U,
0x30U, 0x2CU, 0x20U, 0x73U, 0x69U, 0x7AU, 0x65U, 0x2DU, 0x32U, 0x35U,
0x36U, 0x2AU, 0x33U, 0x2CU, 0x20U, 0x22U, 0x31U, 0x22U, 0x2CU, 0x20U,
0x31U, 0x29U, 0x00U,
}},
/* ==== WASM: 74 ==== */
{R"[test.hook](
#include <stdint.h>
extern int32_t _g (uint32_t id, uint32_t maxiter);
@@ -15512,7 +15681,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
0x00U,
}},
/* ==== WASM: 74 ==== */
/* ==== WASM: 75 ==== */
{R"[test.hook](
#include <stdint.h>
extern int32_t _g (uint32_t id, uint32_t maxiter);
@@ -15862,7 +16031,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
0x20U, 0x30U, 0x00U,
}},
/* ==== WASM: 75 ==== */
/* ==== WASM: 76 ==== */
{R"[test.hook](
#include <stdint.h>
extern int32_t _g (uint32_t id, uint32_t maxiter);
@@ -15998,7 +16167,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
0x00U,
}},
/* ==== WASM: 76 ==== */
/* ==== WASM: 77 ==== */
{R"[test.hook](
#include <stdint.h>
extern int32_t _g (uint32_t id, uint32_t maxiter);
@@ -16171,7 +16340,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
0x54U, 0x5FU, 0x45U, 0x58U, 0x49U, 0x53U, 0x54U, 0x00U,
}},
/* ==== WASM: 77 ==== */
/* ==== WASM: 78 ==== */
{R"[test.hook](
#include <stdint.h>
extern int32_t _g (uint32_t id, uint32_t maxiter);
@@ -16319,7 +16488,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
0x30U, 0x00U, 0x22U, 0x00U, 0x00U, 0x00U, 0x00U,
}},
/* ==== WASM: 78 ==== */
/* ==== WASM: 79 ==== */
{R"[test.hook](
#include <stdint.h>
extern int32_t _g (uint32_t id, uint32_t maxiter);
@@ -16416,7 +16585,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
0x3DU, 0x20U, 0x30U, 0x00U,
}},
/* ==== WASM: 79 ==== */
/* ==== WASM: 80 ==== */
{R"[test.hook](
#include <stdint.h>
extern int32_t _g (uint32_t id, uint32_t maxiter);
@@ -16475,7 +16644,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
0x4FU, 0x46U, 0x5FU, 0x42U, 0x4FU, 0x55U, 0x4EU, 0x44U, 0x53U, 0x00U,
}},
/* ==== WASM: 80 ==== */
/* ==== WASM: 81 ==== */
{R"[test.hook](
#include <stdint.h>
extern int32_t _g (uint32_t id, uint32_t maxiter);
@@ -16534,7 +16703,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
0x4EU, 0x44U, 0x53U, 0x00U,
}},
/* ==== WASM: 81 ==== */
/* ==== WASM: 82 ==== */
{R"[test.hook](
#include <stdint.h>
extern int32_t _g (uint32_t id, uint32_t maxiter);
@@ -18363,7 +18532,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
0x53U, 0x4DU, 0x41U, 0x4CU, 0x4CU, 0x00U,
}},
/* ==== WASM: 82 ==== */
/* ==== WASM: 83 ==== */
{R"[test.hook](
#include <stdint.h>
extern int32_t _g (uint32_t id, uint32_t maxiter);
@@ -19643,7 +19812,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
0x29U, 0x2CU, 0x20U, 0x30U, 0x2CU, 0x30U, 0x20U, 0x29U, 0x29U, 0x00U,
}},
/* ==== WASM: 83 ==== */
/* ==== WASM: 84 ==== */
{R"[test.hook](
#include <stdint.h>
extern int32_t _g (uint32_t id, uint32_t maxiter);
@@ -22576,7 +22745,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
0x4FU, 0x4FU, 0x5FU, 0x53U, 0x4DU, 0x41U, 0x4CU, 0x4CU, 0x00U,
}},
/* ==== WASM: 84 ==== */
/* ==== WASM: 85 ==== */
{R"[test.hook](
#include <stdint.h>
extern int32_t _g (uint32_t id, uint32_t maxiter);
@@ -24541,7 +24710,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
0x54U, 0x4FU, 0x4FU, 0x5FU, 0x53U, 0x4DU, 0x41U, 0x4CU, 0x4CU, 0x00U,
}},
/* ==== WASM: 85 ==== */
/* ==== WASM: 86 ==== */
{R"[test.hook](
#include <stdint.h>
extern int32_t _g (uint32_t id, uint32_t maxiter);
@@ -24826,7 +24995,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
0x29U, 0x20U, 0x3DU, 0x3DU, 0x20U, 0x30U, 0x00U,
}},
/* ==== WASM: 86 ==== */
/* ==== WASM: 87 ==== */
{R"[test.hook](
#include <stdint.h>
extern int32_t _g (uint32_t id, uint32_t maxiter);
@@ -24855,7 +25024,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
0x0BU,
}},
/* ==== WASM: 87 ==== */
/* ==== WASM: 88 ==== */
{R"[test.hook](
#include <stdint.h>
extern int32_t _g (uint32_t id, uint32_t maxiter);
@@ -24887,7 +25056,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
0x20U, 0x52U, 0x65U, 0x6AU, 0x65U, 0x63U, 0x74U, 0x65U, 0x64U, 0x00U,
}},
/* ==== WASM: 88 ==== */
/* ==== WASM: 89 ==== */
{R"[test.hook](
(module
(type (;0;) (func (param i32 i32 i64) (result i64)))
@@ -24914,7 +25083,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
0x41U, 0x00U, 0x41U, 0x00U, 0x42U, 0x00U, 0x10U, 0x00U, 0x0BU,
}},
/* ==== WASM: 89 ==== */
/* ==== WASM: 90 ==== */
{R"[test.hook](
(module
(type (;0;) (func (param i32 i32) (result i32)))
@@ -24967,7 +25136,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
0x00U, 0x1AU, 0x0BU,
}},
/* ==== WASM: 90 ==== */
/* ==== WASM: 91 ==== */
{R"[test.hook](
#include <stdint.h>
extern int32_t _g (uint32_t id, uint32_t maxiter);
@@ -31610,7 +31779,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
0x39U, 0x30U, 0x31U, 0x32U, 0x33U, 0x00U,
}},
/* ==== WASM: 91 ==== */
/* ==== WASM: 92 ==== */
{R"[test.hook](
#include <stdint.h>
extern int32_t _g (uint32_t id, uint32_t maxiter);
@@ -31656,7 +31825,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
0x0BU, 0x06U, 0x76U, 0x61U, 0x6CU, 0x75U, 0x65U, 0x00U,
}},
/* ==== WASM: 92 ==== */
/* ==== WASM: 93 ==== */
{R"[test.hook](
#include <stdint.h>
extern int32_t _g (uint32_t id, uint32_t maxiter);