You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A cl_audit system was introduced in this PR #94 which keeps complete revision history of change logs for a tree where the cl_items tracks the current change history for the tree. The cl_audit records also record the corresponding transaction signature and instruction identifier.
Replace the writing of cl_audit with tree_sequence records. The tree_sequence tracks every sequence for a tree seen by the indexer with additional meta information like the transaction signature and instruction identifier (as currently recorded on cl_audits). Instead of writing n change log records per transaction with each sequence change write 1 record for the sequence change only.
CREATE TABLE tree_sequences (
-- Composite primary key consisting of the sequence number and tree public key
seq BIGINT NOT NULL,
tree BYTEA NOT NULL,
-- Index of the leaf causing the tree change
leaf_idx BIGINT,
-- Signature of the transaction associated with the instruction
signature BYTEA NOT NULL,
-- Identifier for the instruction
instruction VARCHAR,
PRIMARY KEY (seq, tree)
);
Uses
Maintain feature parity with the existing getSignaturesForAsset RPC method by providing transaction signatures for tree leaves.
Context
A
cl_audit
system was introduced in this PR #94 which keeps complete revision history of change logs for a tree where the cl_items tracks the current change history for the tree. Thecl_audit
records also record the corresponding transaction signature and instruction identifier.The
cl_audit
records in upstream is a configurable feature that only adds the records but Helius has used these records to provide a getSignaturesForAsset method which returns a list of transaction signatures related to a leaf. https://github.com/rpcpool/digital-asset-rpc-infrastructure/blob/triton-build/digital_asset_types/src/dapi/signatures_for_asset.rs#L21Issues
Proposal
Replace the writing of
cl_audit
withtree_sequence
records. The tree_sequence tracks every sequence for a tree seen by the indexer with additional meta information like the transaction signature and instruction identifier (as currently recorded on cl_audits). Instead of writing n change log records per transaction with each sequence change write 1 record for the sequence change only.Uses
[Feature] Tree Sequence Based Backfilling #150
The text was updated successfully, but these errors were encountered: