Skip to content
New issue

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

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

Already on GitHub? # to your account

open_burn_account errors and comments #3806

Conversation

rachel-bousfield
Copy link
Contributor

While no private key exists for the burn address, one may still create valid signatures for this account by taking advantage of the fact that it's the 6th torsion of the zero point. As an example, here's a valid block to open the account.

{
  "action": "process",
  "json_block": "true",
  "subtype": "open",
  "block": {
    "type": "state",
    "account": "xrb_1111111111111111111111111111111111111111111111111111hifc8npp",
    "previous": "0000000000000000000000000000000000000000000000000000000000000000",
    "representative": "nano_3mhrc9czyfzzok7xeoeaknq6w5ok9horo7d4a99m8tbtbyogg8apz491pkzt",
    "signature": "c9a3f86aae465f0e56513864510f3997561fa2c9e85ea21dc2292309f3cd60220200000000000000000000000000000000000000000000000000000000000000",
    "work": "2d217e0ef5bbbd29",
    "link": "ECCB8CB65CD3106EDA8CE9AA893FEAD497A91BCA903890CBD7A5C59F06AB9113",
    "link_as_account": "nano_3u8djku7snrifufastfcj6zyoo6qo6fwo63rk57xhbg7mw5cq6amt5a1zq14",
    "balance": "205676479000000000000000000000000000000"
  }
}

Right now the RPC returns

{
    "error": "Error processing block"
}

Which is less specific than the opened_burn_account process error that induces it.

This PR handles this case better by

  • Propagating opened_burn_account through the RPC
  • Reducing log level for opened_burn_account so as to reduce the noise potential should someone try publishing lots of these
  • Updating the comments to reflect the mundanity of such blocks

@clemahieu clemahieu added this to the V24.0 milestone May 2, 2022
@@ -3312,6 +3312,9 @@ void nano::json_handler::process ()
rpc_l->ec = nano::error_process::insufficient_work;
break;
}
case nano::process_result::opened_burn_account:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This helps a lot, the RPC caller knows what's up.

@@ -455,7 +455,10 @@ nano::process_return nano::block_processor::process_one (nano::write_transaction
}
case nano::process_result::opened_burn_account:
{
node.logger.always_log (boost::str (boost::format ("*** Rejecting open block for burn account ***: %1%") % hash.to_string ()));
if (node.config.logging.ledger_logging ())

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

always_log to try_log will decrease the log size in case of repeated attempts, I like it.

@clemahieu clemahieu merged commit 07662aa into nanocurrency:develop May 4, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants