mirror of
https://github.com/Xahau/xahaud.git
synced 2026-07-08 07:40:08 +00:00
Compare commits
1 Commits
server-def
...
fixHookMem
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
04b704e8e1 |
@@ -17,6 +17,7 @@
|
||||
#define featureHooksUpdate2 "1"
|
||||
#define fix20250131 "1"
|
||||
#define fixGuardDepth32 "1"
|
||||
#define fixHookMemoryMissing "1"
|
||||
namespace hook_api {
|
||||
struct Rules
|
||||
{
|
||||
@@ -267,6 +268,7 @@ enum hook_log_code : uint16_t {
|
||||
CUSTOM_SECTION_DISALLOWED =
|
||||
86, // the wasm contained a custom section (id=0)
|
||||
INTERNAL_ERROR = 87, // an internal error described by the log text
|
||||
MEMORY_MISSING = 88, // hook wasm did not contain a memory section
|
||||
// RH NOTE: only HookSet msgs got log codes, possibly all Hook log lines
|
||||
// should get a code?
|
||||
};
|
||||
@@ -445,6 +447,7 @@ getImportWhitelist(Rules const& rules)
|
||||
enum GuardRulesVersion : uint64_t {
|
||||
GuardRuleFix20250131 = 0x00000001,
|
||||
GuardRuleDepth32 = 0x00000002,
|
||||
GuardRuleMemoryMissing = 0x00000004,
|
||||
};
|
||||
|
||||
inline uint64_t
|
||||
@@ -455,6 +458,8 @@ getGuardRulesVersion(Rules const& rules)
|
||||
version |= GuardRuleFix20250131;
|
||||
if (rules.enabled(fixGuardDepth32))
|
||||
version |= GuardRuleDepth32;
|
||||
if (rules.enabled(fixHookMemoryMissing))
|
||||
version |= GuardRuleMemoryMissing;
|
||||
return version;
|
||||
}
|
||||
|
||||
|
||||
@@ -893,6 +893,7 @@ validateGuards(
|
||||
int last_import_number = -1;
|
||||
int import_count = 0;
|
||||
int last_section_type = 0;
|
||||
bool has_memory_section = false;
|
||||
for (int i = 8, j = 0; i < wasm.size();)
|
||||
{
|
||||
if (j == i)
|
||||
@@ -1181,11 +1182,24 @@ validateGuards(
|
||||
func_type_map[j] = type_idx;
|
||||
}
|
||||
}
|
||||
else if (section_type == 5) // memory section
|
||||
{
|
||||
has_memory_section = true;
|
||||
}
|
||||
|
||||
i = next_section;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((rulesVersion & hook_api::GuardRuleMemoryMissing) &&
|
||||
!has_memory_section)
|
||||
{
|
||||
GUARDLOG(hook::log::MEMORY_MISSING)
|
||||
<< "Malformed transaction. Hook did not contain a memory section."
|
||||
<< "\n";
|
||||
return {};
|
||||
}
|
||||
|
||||
// we must subtract import_count from the hook and cbak function in order to
|
||||
// be able to look them up in the functions section. this is a rule of the
|
||||
// webassembly spec note that at this point in execution we are guarenteed
|
||||
|
||||
@@ -150,23 +150,32 @@
|
||||
WasmEdge_CallingFrameContext const& frameCtx __VA_OPT__( \
|
||||
COMMA __VA_ARGS__))
|
||||
|
||||
#define HOOK_SETUP() \
|
||||
using enum hook_api::hook_return_code; \
|
||||
try \
|
||||
{ \
|
||||
[[maybe_unused]] ApplyContext& applyCtx = hookCtx.applyCtx; \
|
||||
[[maybe_unused]] auto& view = applyCtx.view(); \
|
||||
[[maybe_unused]] auto j = applyCtx.app.journal("View"); \
|
||||
[[maybe_unused]] WasmEdge_MemoryInstanceContext* memoryCtx = \
|
||||
WasmEdge_CallingFrameGetMemoryInstance(&frameCtx, 0); \
|
||||
[[maybe_unused]] unsigned char* memory = \
|
||||
WasmEdge_MemoryInstanceGetPointer(memoryCtx, 0, 0); \
|
||||
[[maybe_unused]] const uint64_t memory_length = \
|
||||
WasmEdge_MemoryInstanceGetPageSize(memoryCtx) * \
|
||||
WasmEdge_kPageSize; \
|
||||
[[maybe_unused]] auto& api = hookCtx.api(); \
|
||||
if (!memoryCtx || !memory || !memory_length) \
|
||||
return INTERNAL_ERROR;
|
||||
#define HOOK_SETUP() \
|
||||
using enum hook_api::hook_return_code; \
|
||||
try \
|
||||
{ \
|
||||
[[maybe_unused]] ApplyContext& applyCtx = hookCtx.applyCtx; \
|
||||
[[maybe_unused]] auto& view = applyCtx.view(); \
|
||||
[[maybe_unused]] auto j = applyCtx.app.journal("View"); \
|
||||
[[maybe_unused]] WasmEdge_MemoryInstanceContext* memoryCtx = \
|
||||
WasmEdge_CallingFrameGetMemoryInstance(&frameCtx, 0); \
|
||||
if (!memoryCtx) \
|
||||
{ \
|
||||
JLOG(j.warn()) << "HookError[" << HC_ACC() \
|
||||
<< "]: wasm memory is unavailable"; \
|
||||
if (view.rules().enabled(fixHookMemoryMissing)) \
|
||||
{ \
|
||||
hookCtx.result.exitType = hook_api::ExitType::WASM_ERROR; \
|
||||
hookCtx.result.exitReason = ""; \
|
||||
return INTERNAL_ERROR; \
|
||||
} \
|
||||
} \
|
||||
[[maybe_unused]] unsigned char* memory = \
|
||||
WasmEdge_MemoryInstanceGetPointer(memoryCtx, 0, 0); \
|
||||
[[maybe_unused]] const uint64_t memory_length = \
|
||||
WasmEdge_MemoryInstanceGetPageSize(memoryCtx) * \
|
||||
WasmEdge_kPageSize; \
|
||||
[[maybe_unused]] auto& api = hookCtx.api();
|
||||
|
||||
#define HOOK_TEARDOWN() \
|
||||
} \
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
// If you add an amendment here, then do not forget to increment `numFeatures`
|
||||
// in include/xrpl/protocol/Feature.h.
|
||||
|
||||
XRPL_FIX (HookMemoryMissing, Supported::yes, VoteBehavior::DefaultYes)
|
||||
XRPL_FIX (HookMap, Supported::yes, VoteBehavior::DefaultYes)
|
||||
XRPL_FIX (GuardDepth32, Supported::yes, VoteBehavior::DefaultNo)
|
||||
XRPL_FEATURE(NamedHooks, Supported::yes, VoteBehavior::DefaultNo)
|
||||
|
||||
@@ -293,8 +293,6 @@ JSS(effective); // out: ValidatorList
|
||||
// in: UNL
|
||||
JSS(elapsed_seconds);
|
||||
JSS(enabled); // out: AmendmentTable
|
||||
JSS(ledger_enabled); // out: ServerDefinitions (amendment on-ledger)
|
||||
JSS(cfg_forced); // out: ServerDefinitions ([features] config stanza)
|
||||
JSS(engine_result); // out: NetworkOPs, TransactionSign, Submit
|
||||
JSS(engine_result_code); // out: NetworkOPs, TransactionSign, Submit
|
||||
JSS(engine_result_message); // out: NetworkOPs, TransactionSign, Submit
|
||||
|
||||
@@ -3081,6 +3081,100 @@ public:
|
||||
ter(temMALFORMED));
|
||||
}
|
||||
|
||||
void
|
||||
testWasmMissingMemory(FeatureBitset features)
|
||||
{
|
||||
testcase("missing memory");
|
||||
using namespace jtx;
|
||||
|
||||
auto const alice = Account{"alice"};
|
||||
auto const bob = Account{"bob"};
|
||||
auto const carol = Account{"carol"};
|
||||
|
||||
TestHook missing_memory_wasm = wasm[R"[test.hook](
|
||||
(module
|
||||
(type $rollback_type
|
||||
(func (param i32 i32 i64) (result i64)))
|
||||
(type $guard_type (func (param i32 i32) (result i32)))
|
||||
(type $hook_type (func (param i32) (result i64)))
|
||||
(import "env" "rollback"
|
||||
(func $rollback (type $rollback_type)))
|
||||
(import "env" "_g" (func $_g (type $guard_type)))
|
||||
(func $hook (type $hook_type) (param i32) (result i64)
|
||||
i32.const 1
|
||||
i32.const 1
|
||||
i64.const 0
|
||||
call $rollback
|
||||
drop
|
||||
i32.const 1
|
||||
i32.const 1
|
||||
call $_g
|
||||
drop
|
||||
i64.const 0)
|
||||
(export "hook" (func $hook)))
|
||||
)[test.hook]"];
|
||||
|
||||
for (auto const& withFix : {false, true})
|
||||
{
|
||||
// test if the Hook is created before the Amendment is enabled
|
||||
Env env{*this, features - fixHookMemoryMissing};
|
||||
env.fund(XRP(10000), alice, bob, carol);
|
||||
|
||||
env(ripple::test::jtx::hook(alice, {{hso(missing_memory_wasm)}}, 0),
|
||||
M("Install missing memory hook"),
|
||||
HSFEE);
|
||||
env.close();
|
||||
|
||||
if (withFix)
|
||||
{
|
||||
env.enableFeature(fixHookMemoryMissing);
|
||||
env.close();
|
||||
}
|
||||
|
||||
env(pay(bob, alice, XRP(1)),
|
||||
M("Test missing memory hook"),
|
||||
fee(XRP(1)),
|
||||
ter(tecHOOK_REJECTED));
|
||||
|
||||
auto meta = env.meta();
|
||||
BEAST_REQUIRE(meta);
|
||||
BEAST_REQUIRE(meta->isFieldPresent(sfHookExecutions));
|
||||
|
||||
auto const& hookExecutions = meta->getFieldArray(sfHookExecutions);
|
||||
BEAST_REQUIRE(hookExecutions.size() == 1);
|
||||
auto const& e = hookExecutions[0];
|
||||
|
||||
auto const expectedExitType = withFix
|
||||
? hook_api::ExitType::WASM_ERROR
|
||||
: hook_api::ExitType::UNSET;
|
||||
BEAST_EXPECT(
|
||||
e.getFieldU8(sfHookResult) ==
|
||||
static_cast<uint8_t>(expectedExitType));
|
||||
BEAST_EXPECT(e.getFieldVL(sfHookReturnString).size() == 0);
|
||||
BEAST_EXPECT(
|
||||
e.getFieldU64(sfHookReturnCode) ==
|
||||
0x8000000000000001 /* INTERNAL_ERROR */);
|
||||
}
|
||||
|
||||
for (auto const& withFix : {false, true})
|
||||
{
|
||||
// test if the Hook is created after the Amendment is enabled
|
||||
auto f = features - fixHookMemoryMissing;
|
||||
if (withFix)
|
||||
f = f | fixHookMemoryMissing;
|
||||
Env env{*this, f};
|
||||
env.fund(XRP(10000), alice, bob, carol);
|
||||
|
||||
auto const expectedTer =
|
||||
withFix ? TER{temMALFORMED} : TER{tesSUCCESS};
|
||||
env(ripple::test::jtx::hook(alice, {{hso(missing_memory_wasm)}}, 0),
|
||||
M("Install missing memory hook"),
|
||||
HSFEE,
|
||||
ter(expectedTer));
|
||||
env.close();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
test_accept(FeatureBitset features)
|
||||
{
|
||||
@@ -15077,6 +15171,8 @@ public:
|
||||
void
|
||||
testWithFeatures(FeatureBitset features)
|
||||
{
|
||||
testWasmMissingMemory(features);
|
||||
return;
|
||||
testHooksOwnerDir(features);
|
||||
testHooksDisabled(features);
|
||||
testTxStructure(features);
|
||||
@@ -15103,6 +15199,7 @@ public:
|
||||
testFillCopy(features);
|
||||
|
||||
testWasm(features);
|
||||
testWasmMissingMemory(features);
|
||||
test_accept(features);
|
||||
test_rollback(features);
|
||||
|
||||
|
||||
@@ -191,6 +191,42 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
}},
|
||||
|
||||
/* ==== WASM: 1 ==== */
|
||||
{R"[test.hook](
|
||||
(module
|
||||
(type $rollback_type
|
||||
(func (param i32 i32 i64) (result i64)))
|
||||
(type $guard_type (func (param i32 i32) (result i32)))
|
||||
(type $hook_type (func (param i32) (result i64)))
|
||||
(import "env" "rollback"
|
||||
(func $rollback (type $rollback_type)))
|
||||
(import "env" "_g" (func $_g (type $guard_type)))
|
||||
(func $hook (type $hook_type) (param i32) (result i64)
|
||||
i32.const 1
|
||||
i32.const 1
|
||||
i64.const 0
|
||||
call $rollback
|
||||
drop
|
||||
i32.const 1
|
||||
i32.const 1
|
||||
call $_g
|
||||
drop
|
||||
i64.const 0)
|
||||
(export "hook" (func $hook)))
|
||||
)[test.hook]",
|
||||
{
|
||||
0x00U, 0x61U, 0x73U, 0x6DU, 0x01U, 0x00U, 0x00U, 0x00U, 0x01U, 0x13U,
|
||||
0x03U, 0x60U, 0x03U, 0x7FU, 0x7FU, 0x7EU, 0x01U, 0x7EU, 0x60U, 0x02U,
|
||||
0x7FU, 0x7FU, 0x01U, 0x7FU, 0x60U, 0x01U, 0x7FU, 0x01U, 0x7EU, 0x02U,
|
||||
0x19U, 0x02U, 0x03U, 0x65U, 0x6EU, 0x76U, 0x08U, 0x72U, 0x6FU, 0x6CU,
|
||||
0x6CU, 0x62U, 0x61U, 0x63U, 0x6BU, 0x00U, 0x00U, 0x03U, 0x65U, 0x6EU,
|
||||
0x76U, 0x02U, 0x5FU, 0x67U, 0x00U, 0x01U, 0x03U, 0x02U, 0x01U, 0x02U,
|
||||
0x07U, 0x08U, 0x01U, 0x04U, 0x68U, 0x6FU, 0x6FU, 0x6BU, 0x00U, 0x02U,
|
||||
0x0AU, 0x16U, 0x01U, 0x14U, 0x00U, 0x41U, 0x01U, 0x41U, 0x01U, 0x42U,
|
||||
0x00U, 0x10U, 0x00U, 0x1AU, 0x41U, 0x01U, 0x41U, 0x01U, 0x10U, 0x01U,
|
||||
0x1AU, 0x42U, 0x00U, 0x0BU,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 2 ==== */
|
||||
{R"[test.hook](
|
||||
(module
|
||||
(type (;0;) (func (param i32 i32) (result i64)))
|
||||
@@ -240,7 +276,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x0BU,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 2 ==== */
|
||||
/* ==== WASM: 3 ==== */
|
||||
{R"[test.hook](
|
||||
(module
|
||||
(type (;0;) (func (param i32 i32) (result i64)))
|
||||
@@ -294,7 +330,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x14U, 0x10U, 0x00U, 0x1AU, 0x0CU, 0x00U, 0x0BU, 0x0BU,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 3 ==== */
|
||||
/* ==== WASM: 4 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -361,7 +397,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x80U, 0x80U, 0x00U, 0x20U, 0x02U, 0x0BU,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 4 ==== */
|
||||
/* ==== WASM: 5 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -467,7 +503,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x6AU, 0x24U, 0x80U, 0x80U, 0x80U, 0x80U, 0x00U, 0x20U, 0x03U, 0x0BU,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 5 ==== */
|
||||
/* ==== WASM: 6 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -542,7 +578,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x6AU, 0x24U, 0x80U, 0x80U, 0x80U, 0x80U, 0x00U, 0x20U, 0x05U, 0x0BU,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 6 ==== */
|
||||
/* ==== WASM: 7 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g(uint32_t, uint32_t);
|
||||
@@ -1159,7 +1195,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x78U, 0x29U, 0x29U, 0x20U, 0x3DU, 0x3DU, 0x20U, 0x33U, 0x32U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 7 ==== */
|
||||
/* ==== WASM: 8 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g(uint32_t, uint32_t);
|
||||
@@ -1588,7 +1624,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 8 ==== */
|
||||
/* ==== WASM: 9 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -1794,7 +1830,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x3DU, 0x20U, 0x30U, 0x78U, 0x45U, 0x31U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 9 ==== */
|
||||
/* ==== WASM: 10 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -1916,7 +1952,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x58U, 0x4EU, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 10 ==== */
|
||||
/* ==== WASM: 11 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -2049,7 +2085,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x4FU, 0x4EU, 0x43U, 0x45U, 0x53U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 11 ==== */
|
||||
/* ==== WASM: 12 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -2129,7 +2165,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x54U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 12 ==== */
|
||||
/* ==== WASM: 13 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -2174,7 +2210,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x30U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 13 ==== */
|
||||
/* ==== WASM: 14 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -2493,7 +2529,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x80U, 0x80U, 0x80U, 0x00U, 0x0BU,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 14 ==== */
|
||||
/* ==== WASM: 15 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -3279,7 +3315,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x37U, 0x36U, 0x33U, 0x4CU, 0x4CU, 0x20U, 0x29U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 15 ==== */
|
||||
/* ==== WASM: 16 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -3669,7 +3705,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x80U, 0x80U, 0x80U, 0x00U, 0x0BU,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 16 ==== */
|
||||
/* ==== WASM: 17 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -3850,7 +3886,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x38U, 0x4CU, 0x4CU, 0x29U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 17 ==== */
|
||||
/* ==== WASM: 18 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -4039,7 +4075,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x29U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 18 ==== */
|
||||
/* ==== WASM: 19 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -4278,7 +4314,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x00U, 0x42U, 0x00U, 0x10U, 0x85U, 0x80U, 0x80U, 0x80U, 0x00U, 0x0BU,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 19 ==== */
|
||||
/* ==== WASM: 20 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -4980,7 +5016,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x38U, 0x35U, 0x35U, 0x32U, 0x55U, 0x29U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 20 ==== */
|
||||
/* ==== WASM: 21 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -6325,7 +6361,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x20U, 0x29U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 21 ==== */
|
||||
/* ==== WASM: 22 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -6427,7 +6463,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x84U, 0x80U, 0x80U, 0x80U, 0x00U, 0x0BU,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 22 ==== */
|
||||
/* ==== WASM: 23 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -6470,7 +6506,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x00U, 0x0BU,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 23 ==== */
|
||||
/* ==== WASM: 24 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -6618,7 +6654,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x34U, 0x34U, 0x4CU, 0x4CU, 0x2CU, 0x20U, 0x33U, 0x29U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 24 ==== */
|
||||
/* ==== WASM: 25 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -6946,7 +6982,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x38U, 0x34U, 0x39U, 0x30U, 0x4CU, 0x4CU, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 25 ==== */
|
||||
/* ==== WASM: 26 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -7151,7 +7187,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x10U, 0x85U, 0x80U, 0x80U, 0x80U, 0x00U, 0x0BU,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 26 ==== */
|
||||
/* ==== WASM: 27 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -7835,7 +7871,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x20U, 0x3DU, 0x3DU, 0x20U, 0x30U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 27 ==== */
|
||||
/* ==== WASM: 28 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -8130,7 +8166,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x32U, 0x34U, 0x31U, 0x36U, 0x55U, 0x4CU, 0x4CU, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 28 ==== */
|
||||
/* ==== WASM: 29 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -8843,7 +8879,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x31U, 0x33U, 0x33U, 0x38U, 0x20U, 0x29U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 29 ==== */
|
||||
/* ==== WASM: 30 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -8928,7 +8964,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x30U, 0x29U, 0x20U, 0x3DU, 0x3DU, 0x20U, 0x32U, 0x30U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 30 ==== */
|
||||
/* ==== WASM: 31 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -8990,7 +9026,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x80U, 0x80U, 0x00U, 0x0BU,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 31 ==== */
|
||||
/* ==== WASM: 32 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -9067,7 +9103,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x31U, 0x29U, 0x20U, 0x3DU, 0x3DU, 0x20U, 0x33U, 0x32U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 32 ==== */
|
||||
/* ==== WASM: 33 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -9144,7 +9180,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x31U, 0x29U, 0x20U, 0x3DU, 0x3DU, 0x20U, 0x33U, 0x32U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 33 ==== */
|
||||
/* ==== WASM: 34 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -9401,7 +9437,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x00U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 34 ==== */
|
||||
/* ==== WASM: 35 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -9559,7 +9595,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x04U, 0x00U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 35 ==== */
|
||||
/* ==== WASM: 36 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -9912,7 +9948,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x00U, 0x2AU, 0x04U, 0x00U, 0x00U, 0x31U, 0x04U, 0x00U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 36 ==== */
|
||||
/* ==== WASM: 37 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -9945,7 +9981,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x82U, 0x80U, 0x80U, 0x80U, 0x00U, 0x1AU, 0x20U, 0x01U, 0x0BU,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 37 ==== */
|
||||
/* ==== WASM: 38 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -10172,7 +10208,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 38 ==== */
|
||||
/* ==== WASM: 39 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -10203,7 +10239,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x80U, 0x80U, 0x00U, 0x1AU, 0x20U, 0x01U, 0x0BU,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 39 ==== */
|
||||
/* ==== WASM: 40 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -10514,7 +10550,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 40 ==== */
|
||||
/* ==== WASM: 41 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -10591,7 +10627,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x29U, 0x20U, 0x3DU, 0x3DU, 0x20U, 0x33U, 0x32U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 41 ==== */
|
||||
/* ==== WASM: 42 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -10625,7 +10661,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x80U, 0x80U, 0x00U, 0x1AU, 0x20U, 0x01U, 0x0BU,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 42 ==== */
|
||||
/* ==== WASM: 43 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -10712,7 +10748,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x32U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 43 ==== */
|
||||
/* ==== WASM: 44 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -10746,7 +10782,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x0BU,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 44 ==== */
|
||||
/* ==== WASM: 45 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -10886,7 +10922,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x54U, 0x5FU, 0x4DU, 0x45U, 0x54U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 45 ==== */
|
||||
/* ==== WASM: 46 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -11076,7 +11112,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x31U, 0x34U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 46 ==== */
|
||||
/* ==== WASM: 47 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -11230,7 +11266,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 47 ==== */
|
||||
/* ==== WASM: 48 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -11391,7 +11427,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 48 ==== */
|
||||
/* ==== WASM: 49 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -11548,7 +11584,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x53U, 0x4CU, 0x4FU, 0x54U, 0x53U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 49 ==== */
|
||||
/* ==== WASM: 50 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -11633,7 +11669,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x74U, 0x79U, 0x70U, 0x65U, 0x28U, 0x29U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 50 ==== */
|
||||
/* ==== WASM: 51 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -11890,7 +11926,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x00U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 51 ==== */
|
||||
/* ==== WASM: 52 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -12128,7 +12164,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x3EU, 0x20U, 0x30U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 52 ==== */
|
||||
/* ==== WASM: 53 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -12224,7 +12260,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x53U, 0x54U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 53 ==== */
|
||||
/* ==== WASM: 54 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -12334,7 +12370,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x20U, 0x31U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 54 ==== */
|
||||
/* ==== WASM: 55 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -12464,7 +12500,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x30U, 0x30U, 0x30U, 0x4CU, 0x4CU, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 55 ==== */
|
||||
/* ==== WASM: 56 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -12738,7 +12774,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x30U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 56 ==== */
|
||||
/* ==== WASM: 57 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -12875,7 +12911,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x2CU, 0x20U, 0x73U, 0x29U, 0x20U, 0x3DU, 0x3DU, 0x20U, 0x31U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 57 ==== */
|
||||
/* ==== WASM: 58 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -13169,7 +13205,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x5FU, 0x53U, 0x4CU, 0x4FU, 0x54U, 0x53U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 58 ==== */
|
||||
/* ==== WASM: 59 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -13403,7 +13439,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x5FU, 0x53U, 0x4CU, 0x4FU, 0x54U, 0x53U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 59 ==== */
|
||||
/* ==== WASM: 60 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -13699,7 +13735,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x2CU, 0x20U, 0x31U, 0x29U, 0x20U, 0x3DU, 0x3DU, 0x20U, 0x30U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 60 ==== */
|
||||
/* ==== WASM: 61 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -13903,7 +13939,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x6EU, 0x74U, 0x32U, 0x22U, 0x20U, 0x2BU, 0x20U, 0x69U, 0x29U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 61 ==== */
|
||||
/* ==== WASM: 62 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -14020,7 +14056,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x69U, 0x29U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 62 ==== */
|
||||
/* ==== WASM: 63 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -14129,7 +14165,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x6EU, 0x74U, 0x65U, 0x6EU, 0x74U, 0x32U, 0x22U, 0x29U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 63 ==== */
|
||||
/* ==== WASM: 64 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -14402,7 +14438,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 64 ==== */
|
||||
/* ==== WASM: 65 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
#define sfInvoiceID ((5U << 16U) + 17U)
|
||||
@@ -14621,7 +14657,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x30U, 0x29U, 0x20U, 0x3DU, 0x3DU, 0x20U, 0x33U, 0x32U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 65 ==== */
|
||||
/* ==== WASM: 66 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -14733,7 +14769,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x58U, 0x49U, 0x53U, 0x54U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 66 ==== */
|
||||
/* ==== WASM: 67 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
#define sfInvoiceID ((5U << 16U) + 17U)
|
||||
@@ -14869,7 +14905,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x3DU, 0x20U, 0x33U, 0x32U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 67 ==== */
|
||||
/* ==== WASM: 68 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -15005,7 +15041,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x49U, 0x47U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 68 ==== */
|
||||
/* ==== WASM: 69 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -15144,7 +15180,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x66U, 0x28U, 0x64U, 0x61U, 0x74U, 0x61U, 0x32U, 0x29U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 69 ==== */
|
||||
/* ==== WASM: 70 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -15256,7 +15292,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x29U, 0x20U, 0x3DU, 0x3DU, 0x20U, 0x30U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 70 ==== */
|
||||
/* ==== WASM: 71 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -15350,7 +15386,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x61U, 0x64U, 0x5BU, 0x69U, 0x5DU, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 71 ==== */
|
||||
/* ==== WASM: 72 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -15483,7 +15519,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x64U, 0x5BU, 0x69U, 0x5DU, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 72 ==== */
|
||||
/* ==== WASM: 73 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -15571,7 +15607,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x61U, 0x74U, 0x61U, 0x29U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 73 ==== */
|
||||
/* ==== WASM: 74 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
#define sfInvoiceID ((5U << 16U) + 17U)
|
||||
@@ -15682,7 +15718,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x20U, 0x33U, 0x32U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 74 ==== */
|
||||
/* ==== WASM: 75 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -15893,7 +15929,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 75 ==== */
|
||||
/* ==== WASM: 76 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -16001,7 +16037,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x20U, 0x22U, 0x32U, 0x22U, 0x2CU, 0x20U, 0x31U, 0x29U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 76 ==== */
|
||||
/* ==== WASM: 77 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -16613,7 +16649,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 77 ==== */
|
||||
/* ==== WASM: 78 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -16800,7 +16836,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x63U, 0x65U, 0x29U, 0x20U, 0x3EU, 0x20U, 0x30U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 78 ==== */
|
||||
/* ==== WASM: 79 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -17150,7 +17186,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x20U, 0x30U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 79 ==== */
|
||||
/* ==== WASM: 80 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -17286,7 +17322,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 80 ==== */
|
||||
/* ==== WASM: 81 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -17345,7 +17381,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x64U, 0xE1U, 0xF1U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 81 ==== */
|
||||
/* ==== WASM: 82 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -17518,7 +17554,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x54U, 0x5FU, 0x45U, 0x58U, 0x49U, 0x53U, 0x54U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 82 ==== */
|
||||
/* ==== WASM: 83 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -17666,7 +17702,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x30U, 0x00U, 0x22U, 0x00U, 0x00U, 0x00U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 83 ==== */
|
||||
/* ==== WASM: 84 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -17820,7 +17856,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x0FU, 0x0BU, 0x02U, 0x56U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 84 ==== */
|
||||
/* ==== WASM: 85 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -17917,7 +17953,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x3DU, 0x20U, 0x30U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 85 ==== */
|
||||
/* ==== WASM: 86 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -17976,7 +18012,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x4FU, 0x46U, 0x5FU, 0x42U, 0x4FU, 0x55U, 0x4EU, 0x44U, 0x53U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 86 ==== */
|
||||
/* ==== WASM: 87 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -18035,7 +18071,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x4EU, 0x44U, 0x53U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 87 ==== */
|
||||
/* ==== WASM: 88 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -19864,7 +19900,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x53U, 0x4DU, 0x41U, 0x4CU, 0x4CU, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 88 ==== */
|
||||
/* ==== WASM: 89 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -21483,7 +21519,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x29U, 0x29U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 89 ==== */
|
||||
/* ==== WASM: 90 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -24416,7 +24452,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x4FU, 0x4FU, 0x5FU, 0x53U, 0x4DU, 0x41U, 0x4CU, 0x4CU, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 90 ==== */
|
||||
/* ==== WASM: 91 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -26381,7 +26417,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x54U, 0x4FU, 0x4FU, 0x5FU, 0x53U, 0x4DU, 0x41U, 0x4CU, 0x4CU, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 91 ==== */
|
||||
/* ==== WASM: 92 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -26666,7 +26702,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x29U, 0x20U, 0x3DU, 0x3DU, 0x20U, 0x30U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 92 ==== */
|
||||
/* ==== WASM: 93 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g(uint32_t, uint32_t);
|
||||
@@ -27253,7 +27289,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x4EU, 0x5FU, 0x46U, 0x41U, 0x49U, 0x4CU, 0x55U, 0x52U, 0x45U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 93 ==== */
|
||||
/* ==== WASM: 94 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -27282,7 +27318,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x0BU,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 94 ==== */
|
||||
/* ==== WASM: 95 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -27314,7 +27350,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x20U, 0x52U, 0x65U, 0x6AU, 0x65U, 0x63U, 0x74U, 0x65U, 0x64U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 95 ==== */
|
||||
/* ==== WASM: 96 ==== */
|
||||
{R"[test.hook](
|
||||
(module
|
||||
(type (;0;) (func (param i32 i32 i64) (result i64)))
|
||||
@@ -27341,7 +27377,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x41U, 0x00U, 0x41U, 0x00U, 0x42U, 0x00U, 0x10U, 0x00U, 0x0BU,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 96 ==== */
|
||||
/* ==== WASM: 97 ==== */
|
||||
{R"[test.hook](
|
||||
(module
|
||||
(type (;0;) (func (param i32 i32) (result i32)))
|
||||
@@ -27394,7 +27430,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x00U, 0x1AU, 0x0BU,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 97 ==== */
|
||||
/* ==== WASM: 98 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -34037,7 +34073,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x39U, 0x30U, 0x31U, 0x32U, 0x33U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 98 ==== */
|
||||
/* ==== WASM: 99 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -34083,7 +34119,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x0BU, 0x06U, 0x76U, 0x61U, 0x6CU, 0x75U, 0x65U, 0x00U,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 99 ==== */
|
||||
/* ==== WASM: 100 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
@@ -34112,7 +34148,7 @@ std::map<std::string, std::vector<uint8_t>> wasm = {
|
||||
0x0BU,
|
||||
}},
|
||||
|
||||
/* ==== WASM: 100 ==== */
|
||||
/* ==== WASM: 101 ==== */
|
||||
{R"[test.hook](
|
||||
#include <stdint.h>
|
||||
extern int64_t accept (uint32_t read_ptr, uint32_t read_len, int64_t error_code);
|
||||
|
||||
@@ -186,13 +186,10 @@ public:
|
||||
bool expectObsolete =
|
||||
(votes.at(feature[jss::name].asString()) ==
|
||||
VoteBehavior::Obsolete);
|
||||
// "enabled" is now the effective value (ledger_voted || forced);
|
||||
// this default env votes nothing onto the ledger, so assert on the
|
||||
// canonical on-ledger flag.
|
||||
BEAST_EXPECTS(
|
||||
feature.isMember(jss::ledger_enabled) &&
|
||||
!feature[jss::ledger_enabled].asBool(),
|
||||
feature[jss::name].asString() + " ledger_enabled");
|
||||
feature.isMember(jss::enabled) &&
|
||||
!feature[jss::enabled].asBool(),
|
||||
feature[jss::name].asString() + " enabled");
|
||||
BEAST_EXPECTS(
|
||||
feature.isMember(jss::vetoed) &&
|
||||
feature[jss::vetoed].isBool() == !expectObsolete &&
|
||||
@@ -240,12 +237,10 @@ public:
|
||||
bool expectObsolete =
|
||||
(votes.at((*it)[jss::name].asString()) ==
|
||||
VoteBehavior::Obsolete);
|
||||
// expectEnabled reflects the on-ledger amendment table, so compare
|
||||
// against ledger_enabled (enabled is now ledger_voted || forced).
|
||||
BEAST_EXPECTS(
|
||||
(*it).isMember(jss::ledger_enabled) &&
|
||||
(*it)[jss::ledger_enabled].asBool() == expectEnabled,
|
||||
(*it)[jss::name].asString() + " ledger_enabled");
|
||||
(*it).isMember(jss::enabled) &&
|
||||
(*it)[jss::enabled].asBool() == expectEnabled,
|
||||
(*it)[jss::name].asString() + " enabled");
|
||||
if (expectEnabled)
|
||||
BEAST_EXPECTS(
|
||||
!(*it).isMember(jss::vetoed),
|
||||
@@ -365,78 +360,12 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
testConfigForced(FeatureBitset features)
|
||||
{
|
||||
testcase("Config-forced features ([features] stanza)");
|
||||
|
||||
using namespace test::jtx;
|
||||
|
||||
// jtx enables amendments by inserting them into config.features (the
|
||||
// same presets mechanism as the [features] config stanza), so passing
|
||||
// a single-feature bitset gives us exactly one config-forced amendment
|
||||
// and votes nothing onto the ledger. server_definitions must then
|
||||
// report that one as effectively enabled, distinguishing the source:
|
||||
// enabled = ledger_enabled || cfg_forced
|
||||
// ledger_enabled = false (never voted onto the ledger)
|
||||
// cfg_forced = true (forced via config) for the one feature only
|
||||
auto const forced = featurePriceOracle;
|
||||
auto const forcedHex = to_string(forced);
|
||||
|
||||
Env env{*this, FeatureBitset(forced)};
|
||||
|
||||
auto jrr = env.rpc("server_definitions")[jss::result];
|
||||
if (!BEAST_EXPECT(jrr.isMember(jss::features)))
|
||||
return;
|
||||
|
||||
bool sawForced = false;
|
||||
for (auto it = jrr[jss::features].begin();
|
||||
it != jrr[jss::features].end();
|
||||
++it)
|
||||
{
|
||||
auto const& f = *it;
|
||||
auto const name = f[jss::name].asString();
|
||||
|
||||
// every entry now carries the split flags
|
||||
if (!BEAST_EXPECTS(
|
||||
f.isMember(jss::enabled) &&
|
||||
f.isMember(jss::ledger_enabled) &&
|
||||
f.isMember(jss::cfg_forced),
|
||||
name + " split flags"))
|
||||
return;
|
||||
|
||||
// nothing is enabled on-ledger in a fresh env
|
||||
BEAST_EXPECTS(
|
||||
!f[jss::ledger_enabled].asBool(), name + " ledger_enabled");
|
||||
|
||||
if (it.key().asString() == forcedHex)
|
||||
{
|
||||
sawForced = true;
|
||||
BEAST_EXPECTS(
|
||||
f[jss::cfg_forced].asBool(), name + " cfg_forced");
|
||||
// ledger_enabled(false) || cfg_forced(true) == true
|
||||
BEAST_EXPECTS(f[jss::enabled].asBool(), name + " enabled");
|
||||
}
|
||||
else
|
||||
{
|
||||
BEAST_EXPECTS(
|
||||
!f[jss::cfg_forced].asBool(), name + " cfg_forced");
|
||||
// not forced and not on-ledger => not effectively enabled
|
||||
BEAST_EXPECTS(
|
||||
f[jss::enabled].asBool() == f[jss::ledger_enabled].asBool(),
|
||||
name + " enabled==ledger_enabled");
|
||||
}
|
||||
}
|
||||
BEAST_EXPECT(sawForced);
|
||||
}
|
||||
|
||||
void
|
||||
testServerFeatures(FeatureBitset features)
|
||||
{
|
||||
testNoParams(features);
|
||||
testSomeEnabled(features);
|
||||
testWithMajorities(features);
|
||||
testConfigForced(features);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include <xrpld/app/main/Application.h>
|
||||
#include <xrpld/app/misc/AmendmentTable.h>
|
||||
#include <xrpld/app/misc/NetworkOPs.h>
|
||||
#include <xrpld/core/Config.h>
|
||||
#include <xrpld/rpc/detail/TransactionSign.h>
|
||||
#include <xrpl/json/json_value.h>
|
||||
#include <xrpl/json/json_writer.h>
|
||||
@@ -546,39 +545,6 @@ doServerDefinitions(RPC::JsonContext& context)
|
||||
features[to_string(h)][jss::majority] =
|
||||
t.time_since_epoch().count();
|
||||
|
||||
// Amendment activation has two independent sources; surface both so a
|
||||
// consumer isn't misled by a node that force-enables amendments:
|
||||
// ledger_enabled : recorded in the on-ledger Amendments object
|
||||
// (network-canonical; what the table reports as
|
||||
// "enabled")
|
||||
// cfg_forced : force-activated via the [features] config stanza
|
||||
// (node-local; active in the Rules regardless of the
|
||||
// ledger, casts no votes, never written on-ledger)
|
||||
// enabled : effective for transaction processing on this
|
||||
// server, i.e. ledger_enabled || cfg_forced
|
||||
for (auto const& name : features.getMemberNames())
|
||||
{
|
||||
Json::Value& entry = features[name];
|
||||
bool const ledgerEnabled = entry[jss::enabled].asBool();
|
||||
entry[jss::ledger_enabled] = ledgerEnabled;
|
||||
entry[jss::cfg_forced] = false;
|
||||
// entry[jss::enabled] is left == ledgerEnabled here; only
|
||||
// cfg_forced amendments below flip it.
|
||||
}
|
||||
for (auto const& h : context.app.config().features)
|
||||
{
|
||||
Json::Value& entry = features[to_string(h)];
|
||||
if (!entry.isMember(jss::name))
|
||||
{
|
||||
if (auto const fname = featureToName(h); !fname.empty())
|
||||
entry[jss::name] = fname;
|
||||
}
|
||||
if (!entry.isMember(jss::ledger_enabled))
|
||||
entry[jss::ledger_enabled] = false;
|
||||
entry[jss::cfg_forced] = true;
|
||||
entry[jss::enabled] = true; // ledger_enabled || cfg_forced
|
||||
}
|
||||
|
||||
lastFeatures = features;
|
||||
{
|
||||
const std::string out = Json::FastWriter().write(features);
|
||||
|
||||
Reference in New Issue
Block a user