Skip to content

Commit 1f36249

Browse files
louisingeraltafan
andauthored
Remove matrix, replace with TxGraph (#627)
* add TxGraph, remove TxTree * fix linter * fix server unit test * fix common unit test * add Txid to TxGraphChunk * tidy up builder.go * remove musig2.go marshaller vars * tidy up nonces and sigs types * renaming * remove reflect * tree/builder.go: add node.graph() method * tree/tx_graph.go: use B64Encode() * client-sdk/client: add Txid to BatchTreeEvent * always use json.Marshall/Unmarshall * service_test: move util function * service_test: cleaning * live-store: use connector chunks * fix linter * postgres * tx_graph: remove crawl method * tx_graph: clean * Update common/tree/tx_graph.go Co-authored-by: Pietralberto Mazza <[email protected]> Signed-off-by: louisinger <[email protected]> * postgres migration: drop view before altering tables * add nbOfOutputs check in tx_graph * client-sdk/rest fix streaming endpoints * Revert * Fix intent cache * Fix test * Fix query * Fix --------- Signed-off-by: louisinger <[email protected]> Co-authored-by: Pietralberto Mazza <[email protected]>
1 parent deca5ef commit 1f36249

File tree

85 files changed

+2919
-3039
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+2919
-3039
lines changed

api-spec/openapi/swagger/ark/v1/indexer.swagger.json

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -968,16 +968,12 @@
968968
"txid": {
969969
"type": "string"
970970
},
971-
"parentTxid": {
972-
"type": "string"
973-
},
974-
"level": {
975-
"type": "integer",
976-
"format": "int32"
977-
},
978-
"levelIndex": {
979-
"type": "integer",
980-
"format": "int32"
971+
"children": {
972+
"type": "object",
973+
"additionalProperties": {
974+
"type": "string"
975+
},
976+
"title": "vout -\u003e txid"
981977
}
982978
}
983979
},

api-spec/openapi/swagger/ark/v1/service.swagger.json

Lines changed: 14 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -630,31 +630,6 @@
630630
}
631631
}
632632
},
633-
"v1Node": {
634-
"type": "object",
635-
"properties": {
636-
"txid": {
637-
"type": "string"
638-
},
639-
"tx": {
640-
"type": "string"
641-
},
642-
"parentTxid": {
643-
"type": "string"
644-
},
645-
"level": {
646-
"type": "integer",
647-
"format": "int32"
648-
},
649-
"levelIndex": {
650-
"type": "integer",
651-
"format": "int32"
652-
},
653-
"leaf": {
654-
"type": "boolean"
655-
}
656-
}
657-
},
658633
"v1Outpoint": {
659634
"type": "object",
660635
"properties": {
@@ -795,13 +770,8 @@
795770
"type": "integer",
796771
"format": "int32"
797772
},
798-
"level": {
799-
"type": "integer",
800-
"format": "int32"
801-
},
802-
"levelIndex": {
803-
"type": "integer",
804-
"format": "int32"
773+
"txid": {
774+
"type": "string"
805775
},
806776
"signature": {
807777
"type": "string"
@@ -841,8 +811,18 @@
841811
"type": "integer",
842812
"format": "int32"
843813
},
844-
"treeTx": {
845-
"$ref": "#/definitions/v1Node"
814+
"txid": {
815+
"type": "string"
816+
},
817+
"tx": {
818+
"type": "string"
819+
},
820+
"children": {
821+
"type": "object",
822+
"additionalProperties": {
823+
"type": "string"
824+
},
825+
"title": "output index -\u003e child txid"
846826
}
847827
}
848828
},

api-spec/protobuf/ark/v1/indexer.proto

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,7 @@ message IndexerOutpoint {
266266

267267
message IndexerNode {
268268
string txid = 1;
269-
string parent_txid = 3;
270-
int32 level = 4;
271-
int32 level_index = 5;
269+
map<uint32, string> children = 2; // vout -> txid
272270
}
273271

274272
message IndexerVtxo {

api-spec/protobuf/ark/v1/types.proto

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,6 @@ message Output {
1919
uint64 amount = 2; // Amount to send in satoshis.
2020
}
2121

22-
message Tree {
23-
repeated TreeLevel levels = 1;
24-
}
25-
26-
message TreeLevel {
27-
repeated Node nodes = 1;
28-
}
29-
30-
message Node {
31-
string txid = 1;
32-
string tx = 2;
33-
string parent_txid = 3;
34-
int32 level = 4;
35-
int32 level_index = 5;
36-
bool leaf = 6;
37-
}
38-
3922
message Vtxo {
4023
Outpoint outpoint = 1;
4124
uint64 amount = 2;
@@ -111,16 +94,17 @@ message TreeNoncesAggregatedEvent {
11194

11295
message TreeTxEvent {
11396
string id = 1;
114-
repeated string topic = 2;
97+
repeated string topic = 2;
11598
int32 batch_index = 3;
116-
Node tree_tx = 4;
99+
string txid = 4;
100+
string tx = 5;
101+
map<uint32, string> children = 6; // output index -> child txid
117102
}
118103

119104
message TreeSignatureEvent {
120105
string id = 1;
121106
repeated string topic = 2;
122107
int32 batch_index = 3;
123-
int32 level = 4;
124-
int32 level_index = 5;
125-
string signature = 6;
108+
string txid = 4;
109+
string signature = 5;
126110
}

api-spec/protobuf/gen/ark/v1/admin.pb.gw.go

Lines changed: 24 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)