Repository navigation
@odatano/nightgate 0.25.0
@odatano/nightgate 0.25.0
The crawler indexes unshielded UTXOs, and two optional passes fill the rest.
No circuit change; one schema delta.
The Midnight pallet reports every applied ledger transaction in
System.Events, which the crawler already fetched and decoded with the
block's own runtime metadata before keeping only ExtrinsicSuccess and
ExtrinsicFailed. What follows comes out of the records it was dropping, so
it costs no extra call per block.
UnshieldedUtxosfromMidnight.UnshieldedTokens, which carries a
transaction's consumed and produced outputs. A spend is matched to its
output by(intentHash, outputIndex), including one created in the same
block. The Bech32mownerand the DUSTinitialNonceare derived per row
and reproduce the Midnight indexer's values;ctimeis the block
timestamp.NightBalancesfollow, folded in block by block under the same rule
the reorg rollback rebuilds them with. NIGHT only: other tokens in the
same UTXO set stay out of these figures.ContractActionscarry theiraddressand record a maintenance
update asUPDATE, one row per action the chain reported. These are the
actions that APPLIED; a call in a failed segment of a partial success is
not among them.TransactionscarryledgerTxHash,contractAddressand the
transfer participants where the movement is unambiguous.txTypefollows
the events, not the pallet index alone.TransactionResultsrecordPARTIAL_SUCCESS.
Two optional passes
Both trail the indexed tip with their own cursor on SyncState, both are
off by default, and neither can hold up indexing. A pass advances its cursor
only when neither the cursor nor reorgGeneration moved since it read them;
resetting a cursor replays the range.
crawler.decodePayloads/NIGHTGATE_CRAWLER_DECODE_PAYLOADSdecodes
the ledger transaction inside each stored extrinsic into circuit names,
identifiers and the zswap and DUST counts, recordingdecoded,absent
orfailedper row. Off by default because the decode runs in wasm on the
main thread: 9 ms median, 139 ms worst case over 122 live payloads.crawler.indexerSupplement/NIGHTGATE_CRAWLER_INDEXER_SUPPLEMENT
fillsTransactionFees.paidFees,TransactionSegments,
ContractActions.state,ContractBalances, both ledger-event streams and
registeredForDustGenerationfrom the Midnight indexer. A second source
with its own cursor, not a wider crawl: with the pass off the crawler
still reads a node and owes nothing to an indexer. Rows join on
ledgerTxHash, and re-running a block replaces its rows.
The paid fee is computable from the ledger with the block's parameters, but
those change per block and only the indexer serves them, so it is read
rather than recomputed. Without the supplement it stays zero.
Transactions.dustConsumed is a different figure: what a transaction's DUST
spends declare.
Upgrade. npx nightgate-schema-delta migrates the DB. UnshieldedUtxos
becomes unique on (intentHash, outputIndex) instead of
(createdAtTransaction, outputIndex), because one transaction can carry
several intents whose outputs both start at 0. Blocks.stateRoot takes over
the substrate header's state root, which was being written into a column
named ledgerParameters; the migration moves existing values across and
that column now holds the ledger parameters, filled by the supplement only
when they change. An index built before this release holds no UTXO rows, so
the new columns fill from the first block indexed afterward; a full history
needs a re-index.
Full Changelog: v0.24.5...v0.25.0