Skip to content

Commit 1269e0a

Browse files
committed
fix immutable ledger cddl definitions
1 parent ed6da67 commit 1269e0a

File tree

4 files changed

+21
-21
lines changed

4 files changed

+21
-21
lines changed

docs/src/architecture/08_concepts/immutable_ledger/cddl/Earthfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ check-cddl:
77

88
WORKDIR /cddl
99

10-
COPY ./block.cddl ./genesis_to_prev_hash.cddl .
10+
COPY ./block.cddl ./genesis_to_prev_hash.cddl ./hash.cddl .
1111

12+
RUN cddlc -2 hash.cddl
1213
RUN cddlc -2 block.cddl
1314
RUN cddlc -2 genesis_to_prev_hash.cddl
Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
block = [
2-
block_header,
2+
block-header,
33
block-data,
44
validator-signature,
55
]
66

7-
block_header = [
7+
block-header = [
88
chain-id: ULID,
99
height: int,
1010
timestamp: #6.1(uint .ge 1722470400), ; Epoch-based date/time
11-
prev-block-id: hash_bytes, ; hash of the previous block
11+
prev-block-id: hash-bytes, ; hash of the previous block
1212
?ledger-type: UUID,
1313
?purpose-id: ULID / UUID,
1414
?validator,
@@ -20,14 +20,11 @@ block-data = encoded-cbor
2020
UUID = #6.37(bytes) ; UUID type
2121
ULID = #6.32780(bytes) ; ULID type
2222

23-
hash_bytes = (
24-
#6.32781(bytes) / ; Blake3 hash
25-
#6.32782(bytes) / ; Blake2b hash
26-
#6.32783(bytes) ; Blake2s hash
27-
)
28-
kid = hash_bytes ; hash of the x509/c509 certificate
23+
kid = hash-bytes ; hash of the x509/c509 certificate
2924

3025
validator = (kid / [2* kid])
3126
metadata = [ *any ]
3227

3328
validator-signature = (bytes / [2* bytes])
29+
30+
;# include hash
Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
1-
genesis_to_prev_hash = [
2-
chain_id: ULID,
3-
timestamp: ~#6.1(uint .ge 1722470400), ; Epoch-based date/time
4-
ledger_type: UUID,
5-
purpose_id: ULID / UUID,
1+
genesis-to-prev-hash = [
2+
chain-id: ULID,
3+
timestamp: #6.1(uint .ge 1722470400), ; Epoch-based date/time
4+
ledger-type: UUID,
5+
purpose-id: ULID / UUID,
66
validator,
77
]
88

99
UUID = #6.37(bytes) ; UUID type
1010
ULID = #6.32780(bytes) ; ULID type
1111

1212
validator = (kid / [2* kid])
13-
kid = hash_bytes ; hash of the x509/c509 certificate
14-
hash_bytes = (
15-
#6.32781(bytes) \ ; Blake3 hash
16-
#6.32782(bytes) \ ; Blake2b hash
17-
#6.32783(bytes) ; Blake2s hash
18-
)
13+
kid = hash-bytes ; hash of the x509/c509 certificate
14+
15+
;# include hash
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
hash-bytes = (
2+
#6.32781(bytes) / ; Blake3 hash
3+
#6.32782(bytes) / ; Blake2b hash
4+
#6.32783(bytes) ; Blake2s hash
5+
)

0 commit comments

Comments
 (0)