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

get_account_history_operations fails with partial_history and stop at 0 #1490

Closed
pmconrad opened this issue Dec 22, 2018 · 1 comment

Comments

Projects
3 participants
@pmconrad
Copy link
Contributor

commented Dec 22, 2018

Bug Description
See bitshares/bitshares1-core#1567 - if get_account_history_operations is called with stop == 0 and sufficiently large limit on a node with partial history, then the call will fail with an assertion failure when trying to look up 2.9.0 in the database.

Impacts
Describe which portion(s) of BitShares Core may be impacted by this bug. Please tick at least one box.

  • API (the application programming interface)
  • Build (the build process or something prior to compiled code)
  • CLI (the command line wallet)
  • Deployment (the deployment process after building such as Docker, Travis, etc.)
  • DEX (the Decentralized EXchange, market engine, etc.)
  • P2P (the peer-to-peer network for transaction/block propagation)
  • Performance (system or user efficiency, etc.)
  • Protocol (the blockchain logic, consensus, validation, etc.)
  • Security (the security of system or user data, etc.)
  • UX (the User Experience)
  • Other (please add below)

Steps To Reproduce
Steps to reproduce the behavior (example outlined below):

  1. Execute API call {"id":"14","method":"call","params":[4,"get_account_history_operations",["1.2.1097304",0,"1.11.0","1.11.0",60]]}
  2. Received response ```
    {
    "id": 12,
    "jsonrpc": "2.0",
    "error": {
    "code": 1,
    "message": "Assert Exception: maybe_found != nullptr: Unable to find Object 2.9.0",
    "data": {
    "code": 10,
    "name": "assert_exception",
    "message": "Assert Exception",
    "stack": [{
    "context": {
    "level": "error",
    "file": "index.hpp",
    "line": 111,
    "method": "get",
    "hostname": "",
    "thread_name": "th_a",
    "timestamp": "2018-12-21T03:53:35"
    },
    "format": "maybe_found != nullptr: Unable to find Object ${id}",
    "data": {
    "id": "2.9.0"
    }
    }, {
    "context": {
    "level": "warn",
    "file": "websocket_api.cpp",
    "line": 125,
    "method": "on_message",
    "hostname": "",
    "thread_name": "th_a",
    "timestamp": "2018-12-21T03:53:35"
    },
    "format": "",
    "data": {
    "call.method": "call",
    "call.params": [4, "get_account_history_operations", ["1.2.1097304", 0, "1.11.0", "1.11.0", 60]]
    }
    }]
    }
    }
    }

but when I connect the node,"wss://ws.gdex.top", It can return the right data !
{
"id": 12,
"jsonrpc": "2.0",
"result": [{
"id": "1.11.641299970",
"op": [0, {
"fee": {
"amount": 11211,
"asset_id": "1.3.0"
},
"from": "1.2.1208495",
"to": "1.2.1097304",
"amount": {
"amount": 1000000,
"asset_id": "1.3.0"
},
"memo": {
"from": "BTS7wCToEUmDm5mJux1cMyEuXuyocwth4kuRnJnK1YDVDEByiXHT4",
"to": "BTS8LGsjtN3LzVSC3ci4A5Ji3xjVhdQy2jVnNbdMHg5UNLvqJCr7g",
"nonce": "5549980068526969234",
"message": "3526bd037ede96de2e0838a8ffdd197ff3b839e52b93948b8f82a86c54a2ba02a544bfdf87a22f974605146bc47155ef4778db7b44c143579af5985a03a957a3"
},
"extensions": []
}],
"result": [0, {}],
"block_num": 33277997,
"trx_in_block": 18,
"op_in_trx": 0,
"virtual_op": 64333
}]
}```

Expected Behavior
A list of less than 60 operations should be returned.

Additional Context (optional)
The node must be running with partial history, i. e. object 2.6.0 must have been pruned from the database.

CORE TEAM TASK LIST

  • Evaluate / Prioritize Bug Report
  • Refine User Stories / Requirements
  • Define Test Cases
  • Design / Develop Solution
  • Perform QA/Testing
  • Update Documentation
@abitmore

This comment has been minimized.

Copy link
Member

commented Jan 1, 2019

Fixed by #1494.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.