Repository navigation
api: token API leftovers (pages of transfers, TokenTransferGet, counters, cache lock in checkpoints) - #134
Merged
Conversation
…ers, cache lock in checkpoints) - TokenTransfersGet/TokenWalletTransfersGet: a failed transfer is not listed, but it was counted by the offset and the limit before addTokenResult dropped it, so pages came back short. It is now skipped before them. - TokenTransferGet listed any transaction id given, of any contract or none, and the state lookup ((*opers)[id]) added an entry for every id asked. It now answers NOT_FOUND unless the transaction is a transfer call to that token; count is the number listed. - The state of an operation is read without adding to the map (operationState). - 64-bit token counters in i32 API fields report the largest i32 instead of wrapping. - TokensMaster_Serializer saves, loads, clears and hashes the cache under TokensMaster's lock: the API changes it from the block store thread and, since #128, from the background refresh, which can run while a checkpoint is saved. tokens.py: a page of 2 transfers holds 2 though a failed transfer lies between them; TokenTransferGet returns a transfer and refuses an approve().
EnzinoBB
added a commit
that referenced
this pull request
Oct 30, 2026
EnzinoBB
force-pushed
the
fix/api-token-leftovers
branch
from
October 30, 2026 14:29
3ea982d to
82b74de
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The rest of the token API review after #128. API only.
TokenTransfersGet/TokenWalletTransfersGetdo not list a failed transfer, but the offset and the limit counted it beforeaddTokenResultdropped it, so pages came back short. It is now skipped before them.TokenTransferGetlisted any transaction id it was given, of any contract or of none, withcount = 1, and the state lookup(*opers)[id]added an entry to the operations map for every id asked. It now answers NOT_FOUND unless the transaction is a transfer call to that token;countis the number listed.operationState()reads a state without adding to the map (also inaddTokenResult).TokensMaster_Serializersaves, loads, clears and hashes the cache underTokensMaster's lock: the API changes it from the block store thread and, since api: a token cache that follows every token standard, in any build #128, from the background refresh, which can run while a checkpoint is saved.Left as is: the format of
tokens.dat(official checkpoints read it) and the diag API'stokenStandard, which reports what the deploy transaction declares.Test plan
CONTRACTS=1 TOKENS=1 TOKENS_VIA=5 TOKENS_STRICT_API=1with the restart of n5: 0 failures; new checks: a page of 2 transfers holds 2 though a failed transfer lies between them,TokenTransferGetreturns a transfer and refuses anapprove()(the 2 findings are the wrong-type calls, refused by the API after api: refuse a contract call whose method the executor cannot find #132)🤖 Generated with Claude Code