Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 62545a2

Browse files
Alex6323Alex Coatsgrtlr
authored
feat(api): add proof-of-inclusion (PoI) endpoints (#854)
* Create proof-of-inclusion endpoints and initial logic * Cleanup and test Merkle tree hasher * Add db query for pastcone in whiteflag order * Create PoI * Improve hasher * Improve hasher 2 * Implement contains check * Impl proof validation part 1 * Clippy + Format * Faulty License header complaint and clippy belitteling * Fix validity check * Add PoI api spec * Add PoI link * Impl proof validation part 2 * Cleanup Merkle hasher * Cleanup Merkle proof * Test dto roundtrip * Format * Remove key_manager module (as it was kinda bloat) * Update api-poi.yaml * Remove hex prefix for milestone validation * Format * I hate you clippy ... sometimes ;) * Nit * Don't need to fetch the milestone on validation * Make PoI feature default * Return error if decoding public key fails * Include 'white_flag_index' into new combound index * Refactor 'Hashable' enum * Improve 'compute_proof' recursive fn Co-authored-by: Alex Coats <[email protected]> * Refactor 'merkle_proof' module * Document recursive fn * Remove generics from the Merkle hasher Co-authored-by: Alex Coats <[email protected]> * Nit * Add PoI endpoints for applied blocks * Remove dependency on lazy-static * Remove binary response stubs * Simplify audit path algo * Further simplify and document audit path algo * Improve docs * Refer to Core REST API * Debug 1 * Support single block cone audit paths * Improve docs * Impl AsRef for BlockId and make use of it * Cleanup PoI routes * More cleanup Co-authored-by: Alex Coats <[email protected]> Co-authored-by: Jochen Görtler <[email protected]>
1 parent 774d76b commit 62545a2

File tree

20 files changed

+1414
-80
lines changed

20 files changed

+1414
-80
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ ed25519 = { version = "1.5", default-features = false, features = [ "alloc", "pk
6161
ed25519-dalek = { version = "1.0", default-features = false, features = [ "u64_backend" ], optional = true }
6262
hex = { version = "0.4", default-features = false, optional = true }
6363
hyper = { version = "0.14", default-features = false, features = [ "server", "tcp", "stream" ], optional = true }
64-
lazy_static = { version = "1.4", default-features = false, optional = true }
6564
packable = { version = "0.7", default-features = false, optional = true }
6665
rand = { version = "0.8", default-features = false, features = [ "std" ], optional = true }
6766
regex = { version = "1.7", default-features = false, features = [ "std" ], optional = true }
@@ -78,6 +77,9 @@ tonic = { version = "0.8", default-features = false, optional = true }
7877
# Loki
7978
tracing-loki = { version = "0.2", default-features = false, features = [ "compat-0-2-1", "native-tls" ], optional = true }
8079

80+
# PoI
81+
iota-crypto = { version = "0.15", default-features = false, features = [ "blake2b" ], optional = true }
82+
8183
# Stardust types
8284
iota-types = { version = "1.0.0-rc", default-features = false, features = [ "api", "block", "std" ], optional = true }
8385

@@ -92,6 +94,7 @@ default = [
9294
"inx",
9395
"loki",
9496
"metrics",
97+
"poi",
9598
"stardust",
9699
]
97100
analytics = [
@@ -105,7 +108,6 @@ api = [
105108
"dep:hex",
106109
"derive_more/from",
107110
"dep:hyper",
108-
"dep:lazy_static",
109111
"dep:packable",
110112
"dep:rand",
111113
"dep:regex",
@@ -129,6 +131,10 @@ metrics = [
129131
"dep:influxdb",
130132
"dep:chrono",
131133
]
134+
poi = [
135+
"api",
136+
"dep:iota-crypto",
137+
]
132138
rand = [
133139
"iota-types?/rand",
134140
]

0 commit comments

Comments
 (0)