aboutsummaryrefslogtreecommitdiff
path: root/src/test/fuzz
diff options
context:
space:
mode:
author0xb10c <b10c@b10c.me>2023-09-20 19:37:45 +0200
committer0xb10c <b10c@b10c.me>2023-10-02 15:34:28 +0200
commitda384a286bd84a97e7ebe7a64654c5be20ab2df1 (patch)
tree443d2d048e0692a702f6ac46c1d85c573a5d67e8 /src/test/fuzz
parent8909667ab8a65478e0eaa6495299305ad836e835 (diff)
rpc: getrawaddrman for addrman entries
Exposing address manager table entries in a hidden RPC allows to introspect addrman tables in tests and during development. As response JSON object the following FORMAT1 is choosen: { "table": { "<bucket>/<position>": { "address": "..", "port": .., ... }, "<bucket>/<position>": { "address": "..", "port": .., ... }, "<bucket>/<position>": { "address": "..", "port": .., ... }, ... } } An alternative would be FORMAT2 { "table": { "bucket": { "position": { "address": "..", "port": .., ... }, "position": { "address": "..", "port": .., ... }, .. }, "bucket": { "position": { "address": "..", "port": .., ... }, .. }, } } FORMAT1 and FORMAT2 have different encodings for the location of the address in the address manager. While FORMAT2 might be easier to process for downstream tools, it also mimics internal addrman mappings, which might change at some point. Users not interested in the address location can ignore the location key. They don't have to adapt to a new RPC response format, when the internal addrman layout changes. Additionally, FORMAT1 is also slightly easier to to iterate in downstream tools. The RPC response-building implemenation complexcity is lower with FORMAT1 as we can more easily build a "<bucket>/<position>" key than a multiple "bucket" objects with multiple "position" objects (FORMAT2).
Diffstat (limited to 'src/test/fuzz')
-rw-r--r--src/test/fuzz/rpc.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/test/fuzz/rpc.cpp b/src/test/fuzz/rpc.cpp
index 7e9a18e1d0..cffda751df 100644
--- a/src/test/fuzz/rpc.cpp
+++ b/src/test/fuzz/rpc.cpp
@@ -140,6 +140,7 @@ const std::vector<std::string> RPC_COMMANDS_SAFE_FOR_FUZZING{
"getnodeaddresses",
"getpeerinfo",
"getprioritisedtransactions",
+ "getrawaddrman",
"getrawmempool",
"getrawtransaction",
"getrpcinfo",