-
Notifications
You must be signed in to change notification settings - Fork 133
Description
Context
PR #1674 is introducing a supply commitment verifier system that tracks asset supply through three sub-trees: mint, burn, and ignore. Currently, the IgnoreChecker
interface (defined in proof/verifier.go
) only has a mock implementation, and no production IgnoreChecker
instance is passed during proof verification.
Problem
The proof verification system lacks integration with the supply commitment ignore tree. This means:
- Proofs for assets in the ignore tree are still fully validated (performance impact)
- No enforcement of supply commitment ignore rules during proof verification
- Inconsistency between supply tracking and proof validation systems
Proposed Solution
Create a concrete IgnoreChecker
implementation that queries the ignore sub-tree of the supply commitment system. This will automatically reject proofs for assets that have been marked as ignored in the supply tree.
Technical Details
-
Interface to implement:
type IgnoreChecker interface { IsIgnored(prevID AssetPoint) bool }
-
Integration points where
VerifierCtx
needs updating:rpcserver.go
- RPC proof verificationtapfreighter/chain_porter.go
- Chain porter proof handlingtapchannel/aux_funding_controller.go
- Channel funding proof verification- Any other locations creating
VerifierCtx
instances
-
Architecture:
- New file:
tapdb/supply_ignore_checker.go
- Query the ignore sub-tree from
tapdb/ignore_tree.go
- Wire up supply tree store access to verification contexts
- Implement caching layer to avoid repeated database hits for frequently checked assets
- New file:
Implementation Steps
- Create
SupplyIgnoreChecker
struct implementingIgnoreChecker
- Add method to query ignore tree for asset points
- Implement in-memory cache (e.g., LRU cache) for ignore tree lookups
- Update all
VerifierCtx
creation sites to include the new checker - Add unit tests for the new implementation
- Add integration tests verifying ignored assets are rejected
- Add benchmarks to verify cache effectiveness
- Update documentation for the new behavior
Caching Strategy
To optimize performance and reduce database load:
- Implement an LRU cache for ignore tree lookups
- Cache both positive (ignored) and negative (not ignored) results
- Consider cache invalidation strategy when ignore tree is updated
- Make cache size configurable via startup parameters
- Add metrics for cache hit/miss rates
References
- PR supplyverifier: add initial state machine for supply commit verification and proof sync #1674 - Supply commitment verifier implementation
- Issue [feature]: implement on-chain universe asset commitment verifier #1463 - Universe supply tracking feature
proof/verifier.go
- IgnoreChecker interface definitiontapdb/ignore_tree.go
- Ignore tree implementation
Metadata
Metadata
Assignees
Labels
Type
Projects
Status