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

bootstrap - get_coinbase_tx_sum returns height or count is too large instead of method not found #9208

Open
SyntheticBird45 opened this issue Feb 27, 2024 · 3 comments

Comments

@SyntheticBird45
Copy link

v0.18.3.1

Using a fresh node that only synced 5973 blocks in database, --no-sync and --bootstrap-daemon-address <ANY NODE URL>

Behavior

$ curl http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_coinbase_tx_sum","params":{"height":5973,"count":100}}' -H 'Content-Type: application/json'
{
  "id": "0",
  "jsonrpc": "2.0",
  "result": {
    "credits": 0,
    "emission_amount": 17492292945292,
    "emission_amount_top64": 0,
    "fee_amount": 0,
    "fee_amount_top64": 0,
    "status": "OK",
    "top_hash": "",
    "untrusted": false,
    "wide_emission_amount": "0xfe8bde8458c",
    "wide_fee_amount": "0x0"
  }
}
$ curl http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_coinbase_tx_sum","params":{"height":5974,"count":100}}' -H 'Content-Type: application/json'
{
  "id": "0",
  "jsonrpc": "2.0",
  "result": {
    "credits": 0,
    "emission_amount": 0,
    "emission_amount_top64": 0,
    "fee_amount": 0,
    "fee_amount_top64": 0,
    "status": "height or count is too large",
    "top_hash": "",
    "untrusted": false,
    "wide_emission_amount": "",
    "wide_fee_amount": ""
  }
}

Expected Behavior

Node shouldn't tell client that height or count is too large, by solely relying on the database.

@selsta
Copy link
Collaborator

selsta commented Feb 27, 2024

I might be missing something but why should it return method not found?

@SyntheticBird45
Copy link
Author

because the bootstrap daemon have --restricted-rpc. But I'm realizing it's maybe out of scope for get_coinbase_tx_sum to fetch the response to the bootstrap daemon

@selsta
Copy link
Collaborator

selsta commented Feb 28, 2024

The bootstrap-daemon feature was created so that someone can scan a wallet and create a transaction while the local node is still syncing. Endpoints like get_coinbase_tx_sum that require an unrestricted bootstrap node do seem out of scope.

The existing code could be improved for such edge cases but it doesn't seem like high priority.

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

No branches or pull requests

3 participants