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 may terminate early due to using first op as sentinel value #168

Closed
vikramrajkumar opened this issue Jan 18, 2017 · 2 comments
Labels

Comments

@vikramrajkumar
Copy link
Contributor

From @theoreticalbts on February 15, 2016 15:4

Calling get_account_history on the account which owns get_object 1.11.0 may cause the iteration to stop early because of a confusion between two cases:

  • Case 1: There is no next operation_history_object, we have reached the end of the list
  • Case 2: The next operation_history_object exists and has ID zero

The simple fix for new chains is to create a dummy sentinel operation_history_object with ID zero. However, this fix will not work on already-deployed chains because it will change history ID's.

A deployable fix would append 1.11.0 to its result when:

  • The account for which the operation history is being requested is the account for 1.11.0
  • Appending it would not exceed the request limits

Copied from original issue: cryptonomex/graphene#578

@oxarbitrage
Copy link
Member

I was trying to trigger this issue but i was not able to fully understand it.

I am not able to get who is the owner of object 1.11.0, i know it was a claim balance operation to account 1.2.1090:

new >>> get_object 1.11.0
get_object 1.11.0
[{
    "id": "1.11.0",
    "op": [
      37,{
        "fee": {
          "amount": 0,
          "asset_id": "1.3.0"
        },
        "deposit_to_account": "1.2.1090",
        "balance_to_claim": "1.15.4379",
        "balance_owner_key": "BTS7svGgH6ScN862v8SGyck7rVctfm7A2nnD8Yh7yz9ruHoW8rUU7",
        "total_claimed": {
          "amount": 4458,
          "asset_id": "1.3.0"
        }
      }
    ],
    "result": [
      0,{}
    ],
    "block_num": 973,
    "trx_in_block": 0,
    "op_in_trx": 0,
    "virtual_op": 31500
  }
]
new >>> 

But that does not tell me who made the operation to run get_account_history and check if the loop ends earlier than it should.

If someone haves more light over this please post so i can try to get fixed.

@oxarbitrage
Copy link
Member

#347 resolves the problem, closing the issue. thanks @takaaki7

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

No branches or pull requests

2 participants