···4242}
43434444// store and plc must be able to share transaction objects
4545-func NewDIDPLCApplication(treeDB dbm.DB, indexDB dbm.DB, clearData func(), snapshotDirectory string) (*DIDPLCApplication, *transaction.Factory, plc.PLC, func(), error) {
4545+func NewDIDPLCApplication(treeDB dbm.DB, indexDB transaction.ExtendedDB, clearData func(), snapshotDirectory string) (*DIDPLCApplication, *transaction.Factory, plc.PLC, func(), error) {
4646 mkTree := func() *iavl.MutableTree {
4747 // Using SpeedDefault appears to cause the processing time for ExecuteOperation to double on average
4848 // Using SpeedBetterCompression appears to cause the processing time to double again
···6868 runnerContext: context.Background(),
6969 tree: tree,
7070 indexDB: indexDB,
7171- txFactory: transaction.NewFactory(tree, indexDB, store.Tree.NextOperationSequence),
7271 snapshotDirectory: snapshotDirectory,
7372 aocsByPLC: make(map[string]*authoritativeOperationsCache),
7473 }
75747575+ d.txFactory, err = transaction.NewFactory(tree, indexDB, store.Tree.NextOperationSequence, store.Tree.BuildDIDBloomFilter)
7676+ if err != nil {
7777+ return nil, nil, nil, func() {}, stacktrace.Propagate(err, "")
7878+ }
7979+8080+7681 d.fullyClearApplicationData = func() error {
7782 // we assume this is called in a single-threaded context, which should be a safe assumption since we'll only call this during snapshot import
7883 // and CometBFT only calls one ABCI method at a time
···85908691 *d.tree = *mkTree()
87928888- d.txFactory = transaction.NewFactory(tree, indexDB, store.Tree.NextOperationSequence)
9393+ d.txFactory, err = transaction.NewFactory(tree, indexDB, store.Tree.NextOperationSequence, store.Tree.BuildDIDBloomFilter)
9494+ if err != nil {
9595+ return stacktrace.Propagate(err, "")
9696+ }
8997 return nil
9098 }
9199
···110110 // this tree is just to avoid a nil pointer when creating a transaction with the factory
111111 // the transactions don't actually get used
112112 tree := iavl.NewMutableTree(dbm.NewMemDB(), 128, false, iavl.NewNopLogger())
113113- txFactory := transaction.NewFactory(tree, nil, store.Tree.NextOperationSequence)
113113+ txFactory, err := transaction.NewFactory(tree, nil, store.Tree.NextOperationSequence, store.Tree.BuildDIDBloomFilter)
114114+ require.NoError(t, err)
114115115116 t.Run("Test Resolve DID", func(t *testing.T) {
116117 server, err := NewServer(txFactory, mockPLC, nil, "tcp://127.0.0.1:8080", 15*time.Second)
+2-2
plc/impl.go
···2929func (plc *plcImpl) ValidateOperation(ctx context.Context, readTx transaction.Read, did string, opBytes []byte) error {
3030 timestamp := syntax.Datetime(readTx.Timestamp().Format(types.ActualAtprotoDatetimeLayout))
31313232- // TODO set true to false only while importing old ops
3232+ // TODO set last parameter to true only while importing old ops
3333 _, err := plc.validator.Validate(ctx, readTx, timestamp, did, opBytes, true)
3434 if err != nil {
3535 return stacktrace.Propagate(err, "operation failed validation")
···4141func (plc *plcImpl) ExecuteOperation(ctx context.Context, tx transaction.Write, did string, opBytes []byte) error {
4242 timestamp := syntax.Datetime(tx.Timestamp().Format(types.ActualAtprotoDatetimeLayout))
43434444- // TODO set true to false only while importing old ops
4444+ // TODO set last parameter to true only while importing old ops
4545 effects, err := plc.validator.Validate(ctx, tx.Downgrade(), timestamp, did, opBytes, true)
4646 if err != nil {
4747 return stacktrace.Propagate(err, "operation failed validation")