Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

daemon-rpc: doc undocumented fields #2340

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hinto-janai
Copy link
Contributor

What

Adds documentation for undocumented request/response fields within daemon RPC calls; requires review into monerod.

Some of these are lacking descriptions as I'm not sure what the behavior is for some of the fields. I will know after Cuprate/cuprate#244 and may add more docs then.

Fixes

Table of fixes in this PR, originally tracked here: Cuprate/cuprate#159.

Request fields

These endpoints/methods have undocumented request fields.

Endpoint/method Link Notes
get_block_header_by_hash rpc/core_rpc_server_commands_defs.h @ 1245 hashes. This field lets you specify multiple block hashes.
hard_fork_info rpc/core_rpc_server_commands_defs.h @ 1962, rpc/core_rpc_server.cpp @ 2760 version. This field lets you specify which hardfork info to retrieve.
get_output_distribution rpc/core_rpc_server_commands_defs.h @ 2445..2465 top_hash, credits
/get_blocks.bin rpc/core_rpc_server_commands_defs.h @ 174..179 Optional fields: requested_info, no_miner_tx, pool_info_since
/send_raw_transaction rpc/core_rpc_server_commands_defs.h @ 617 do_sanity_checks
/get_peer_list rpc/core_rpc_server_commands_defs.h @ 1373..1374 public_only, include_blocked
/out_peers rpc/core_rpc_server_commands_defs.h @ 1909 set

Response fields

These endpoints/methods have undocumented response fields.

Endpoint/method Link Notes
get_block_header_by_hash rpc/core_rpc_server_commands_defs.h @ L1260 block_headers. This method will return a block_header AND block_headers if the request only provided a hashes. The block_header struct is a bunch of default values (0, "", false).
get_block_header_by_height rpc/core_rpc_server_commands_defs.h @ 1271..1296 top_hash, credits
get_output_distribution rpc/message_data_structs.h @ 205 Field in inner struct output_distribution: cumulative
get_connections cryptonote_protocol/cryptonote_protocol_defs.h @ 47..87 Fields in inner struct connection_info: address_type, rpc_port, rpc_credits_per_hash, pruning_seed
set_bans rpc/core_rpc_server_commands_defs.h @ 2063 untrusted
get_version rpc/core_rpc_server_commands_defs.h @ 2170..2211 current_height, hard_forks, target_height
sync_info rpc/core_rpc_server_commands_defs.h @ 2433 untrusted
get_txpool_backlog diff @ 1567..1575, rpc/core_rpc_server_commands_defs.h @ 1639 Field rename: blob_size -> weight
get_output_distribution rpc/core_rpc_server_commands_defs.h @ 2445..2465 top_hash, credits
add_aux_pow rpc/core_rpc_server_commands_defs.h @ 1103 status, untrusted
/get_blocks.bin rpc/core_rpc_server_commands_defs.h @ 232..240 daemon_time, credits, top_hash
/get_blocks_by_height.bin rpc/core_rpc_server_commands_defs.h @ 281 credits, top_hash
/get_hashes_fast.bin rpc/core_rpc_server_commands_defs.h @ 331 credits, top_hash
/get_o_indexes.bin rpc/core_rpc_server_commands_defs.h @ 505 credits, top_hash
/get_transactions rpc/core_rpc_server_commands_defs.h @ 418 credits, confirmations
/send_raw_transaction rpc/core_rpc_server_commands_defs.h @ 640..643 nonzero_unlock_time, sanity_check_failed, too_few_outputs, tx_extra_too_big
/get_peer_list rpc/core_rpc_server_commands_defs.h @ 1390 untrusted
/stop_daemon rpc/core_rpc_server_commands_defs.h @ 1827 untrusted
submit_block rpc/core_rpc_server_commands_defs.h @ 1123 block_id, status, untrusted

Other

The get_output_distribution method has 2 undocumented fields, binary and compress. The current documentation is also incorrect as the output is not an array of distribution JSON objects, but rather, either raw binary or a JSON byte array. This may change with monero-project/monero#9422 so it is not changed in this PR.

Copy link

netlify bot commented Aug 8, 2024

Deploy Preview for barolo-time-757cf9 ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 8d0b4a8
🔍 Latest deploy log https://app.netlify.com/sites/barolo-time-757cf9/deploys/66b533d7a10e5b000812d5e6
😎 Deploy Preview https://deploy-preview-2340--barolo-time-757cf9.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@hinto-janai hinto-janai marked this pull request as ready for review August 8, 2024 23:56
@HardenedSteel
Copy link
Contributor

FYI migrating docs elsewhere is considered

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants