Skip to content

Commit bc84713

Browse files
authored
Merge pull request #711 from Abdulbois/#703-Conformance-with-matter-spec-Model-module
Achieve conformance against Matter spec - Model and Compliance modules
2 parents ff75899 + 96f795a commit bc84713

31 files changed

Lines changed: 430 additions & 359 deletions

File tree

README-DEV.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Have a look at [How To](docs/how-to.md) and [transactions](docs/transactions.md)
131131

132132
Start a local pool as described above.
133133

134-
Every node exposes a REST API at `http://<node-host>:1317` (see <https://docs.cosmos.network/v0.45/core/grpc_rest.html>).
134+
Every node exposes a REST API at `http://<node-host>:1317` (see <https://docs.cosmos.network/sdk/v0.47/learn/advanced/grpc_rest>).
135135

136136
Have a look at [transactions](docs/transactions.md) for a full list of REST endpoints.
137137

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ See [Run Light Client Proxy](docs/running-light-client-proxy.md) for details how
141141

142142
- **There are no state proofs in REST, so REST queries should be sent to trusted Validator or Observer nodes only.**
143143
- OpenAPI specification: <https://zigbee-alliance.github.io/distributed-compliance-ledger/>.
144-
- Any running node exposes a REST API at port `1317`. See <https://docs.cosmos.network/v0.47/learn/advanced/grpc_rest>.
144+
- Any running node exposes a REST API at port `1317`. See <https://docs.cosmos.network/sdk/v0.47/learn/advanced/grpc_rest>.
145145
- See [transactions](docs/transactions.md) for a full list of endpoints.
146146
- REST HTTP(S) queries can be directly used for read requests.
147147
See [How to read from the Ledger](docs/transactions.md#how-to-read-from-the-ledger).
@@ -152,14 +152,14 @@ See [Run Light Client Proxy](docs/running-light-client-proxy.md) for details how
152152
### gRPC
153153

154154
- **There are no state proofs in gRPC, so gRPC queries should be sent to trusted Validator or Observer nodes only.**
155-
- Any running node exposes a REST API at port `9090`. See <https://docs.cosmos.network/v0.47/learn/advanced/grpc_rest>.
155+
- Any running node exposes a REST API at port `9090`. See <https://docs.cosmos.network/sdk/v0.47/learn/advanced/grpc_rest>.
156156
- A client code can be generated for all popular languages from the proto files [proto](proto), see <https://grpc.io/docs/languages/>.
157157
- The generated client code can be used for read and write requests, i.e. generation and signing of transactions
158158
See [How to read from the Ledger](docs/transactions.md#how-to-read-from-the-ledger) and [How to write to the Ledger](docs/transactions.md#how-to-write-to-the-ledger) for details.
159159

160160
### CometBFT RPC and Light Client
161161

162-
- CometBFT RPC is exposed by every running node at port `26657`. See <https://docs.cosmos.network/v0.47/learn/advanced/grpc_rest#cometbft-rpc>.
162+
- CometBFT RPC is exposed by every running node at port `26657`. See <https://docs.cosmos.network/sdk/v0.47/learn/advanced/grpc_rest#cometbft-rpc>.
163163
- CometBFT RPC supports state proofs. CometBFT's Light Client library can be used to verify the state proofs.
164164
So, if Light Client API is used, then it's possible to communicate with non-trusted nodes.
165165
- Please note, that multi-value queries don't have state proofs support and should be sent to trusted nodes only.
@@ -232,4 +232,4 @@ the following instructions from [how-to.md](docs/how-to.md) can be used for ever
232232
- [CometBFT](https://cometbft.com/)
233233
- [Cosmos SDK](https://cosmos.network/sdk)
234234
- [Ledger Nano Support](docs/ledger-nano.md)
235-
- [Schema Mappings against CHIP/Matter Specification](docs/mapping_against_matter_spec.md)
235+
- [Mapping DCL Entities to Matter Specification](docs/mapping_against_matter_spec.md)

docs/advanced/running-node-in-existing-network.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,4 @@ Possible options when adding Validator, Observer, Sentry or Seed nodes to existi
143143
- Probably error-prone (if at least one migration has a bug, catchup fails)
144144

145145
- References:
146-
- <https://docs.cosmos.network/v0.45/core/upgrade.html#syncing-a-full-node-to-an-upgraded-blockchain>
146+
- <https://docs.cosmos.network/sdk/v0.47/learn/advanced/upgrade#syncing-a-full-node-to-an-upgraded-blockchain>

docs/cometbft-rpc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ dcld tx auth propose-add-account \
127127

128128
### Decoding The Transaction String
129129

130-
The details of transaction payload encoding can be found [here](https://docs.cosmos.network/main/core/encoding#transaction-encoding). Thus, the transaction payload/string in the example above can be decoded as follows:
130+
The details of transaction payload encoding can be found [here](https://docs.cosmos.network/sdk/v0.47/learn/advanced/encoding#transaction-encoding). Thus, the transaction payload/string in the example above can be decoded as follows:
131131

132132
```bash
133133
dcld tx decode CocCCoQCCkgvemlnYmVlYWxsaWFuY2UuZGlzdHJpYnV0ZWRjb21wbGlhbmNlbGVkZ2VyLmRjbGF1dGguTXNnUHJvcG9zZUFkZEFjY291bnQStwEKLWNvc21vczE0cG1nMnhnMzd0enI2a3VxNHV4dnp3a3p1ZnRldGQ3dDhhMnN1dRItY29zbW9zMXNkZzV2a3B6OXVyY2VtbXc2N2xueHZ6aGh1dmVxZTZ2NzBleDJsGkYKHy9jb3Ntb3MuY3J5cHRvLnNlY3AyNTZrMS5QdWJLZXkSIwohA4m98FT/tgsMWZuVBlavWmawwXrvv/nUMhDlU8QsHlOMIglOb2RlQWRtaW44lo/YoAYSWApQCkYKHy9jb3Ntb3MuY3J5cHRvLnNlY3AyNTZrMS5QdWJLZXkSIwohApEHaI8+Wj64IQdR/WZDMaWHNd53+9G19zNcWjrAiXMbEgQKAggBGAISBBDAmgwaQJCg0T8phCo70H7VpL2M1C0kQix4LeVOjkXWgK3EHmFobXkBGLH2jJiKTHakVWUO2yj2Tdpc4YoTDw2eKe6UZj8=

docs/design/benchmarking.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ The following ones makes sense to track:
4242

4343
### Cosmos SDK metrics
4444

45-
Starting from `v0.40.0` Cosmos SDK provides [telemetry](https://docs.cosmos.network/v0.45/core/telemetry.html) package as a server-side support for application performance and behavior explorations.
45+
Starting from `v0.40.0` Cosmos SDK provides [telemetry](https://docs.cosmos.network/sdk/v0.47/learn/advanced/telemetry) package as a server-side support for application performance and behavior explorations.
4646

47-
The following [metrics](https://docs.cosmos.network/v0.45/core/telemetry.html#supported-metrics) make sense to track:
47+
The following [metrics](https://docs.cosmos.network/sdk/v0.47/learn/advanced/telemetry#supported-metrics) make sense to track:
4848

4949
- `tx_count`: Total number of txs processed via DeliverTx (tx)
5050
- `tx_successful`: Total number of successful txs processed via DeliverTx  (tx)
@@ -67,7 +67,7 @@ Notes:
6767

6868
- For the moment it's not clear enough what production setup will look like, in particular:
6969
- number of validators
70-
- type of external endpoints, options are [Cosmos SDK / Tendermint endpoints](https://docs.cosmos.network/v0.45/core/grpc_rest.html)
70+
- type of external endpoints, options are [Cosmos SDK / Tendermint endpoints](https://docs.cosmos.network/sdk/v0.47/learn/advanced/grpc_rest)
7171
- type and number of proxies for validator-validator and client-validator connections
7272

7373
Current assumptions for production:
@@ -94,7 +94,7 @@ Current assumptions for production:
9494

9595
**ToDo** define which client endpoints are considered in production
9696

97-
As long as CosmosSDK (Tendermint) provides multiple client [endpoints](https://docs.cosmos.network/v0.45/core/grpc_rest.html) makes sense to benchmark all of them (separately and in a combination), in particular:
97+
As long as CosmosSDK (Tendermint) provides multiple client [endpoints](https://docs.cosmos.network/sdk/v0.47/learn/advanced/grpc_rest) makes sense to benchmark all of them (separately and in a combination), in particular:
9898

9999
- http RPC
100100
- websocket RPC
@@ -114,7 +114,7 @@ As long as CosmosSDK (Tendermint) provides multiple client [endpoints](https://d
114114

115115
## Load Generation Framework
116116

117-
As long as DCledger based on Cosmos SDK and Tendermint which provide standard HTTP/websocket RPC and REST [endpoints](https://docs.cosmos.network/v0.45/core/grpc_rest.html) to perform both read & write txns generic production ready tools like [jMeter](https://jmeter.apache.org/), [Locust](https://locust.io/), [K6](https://k6.io/) may be used.
117+
As long as DCledger based on Cosmos SDK and Tendermint which provide standard HTTP/websocket RPC and REST [endpoints](https://docs.cosmos.network/sdk/v0.47/learn/advanced/grpc_rest) to perform both read & write txns generic production ready tools like [jMeter](https://jmeter.apache.org/), [Locust](https://locust.io/), [K6](https://k6.io/) may be used.
118118

119119
[Locust](https://locust.io/) looks like the most easy-to-go option:
120120

docs/design/schema-compatibility.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ While offering a robust solution for handling radical changes, this method requi
5050
**Strategy steps:**
5151

5252
- One time actions:
53-
- Create a more flexible, generic schema structure to hold a wide range of data formats (Can be used [Any](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/any.proto) as described in [ADR-19](https://docs.cosmos.network/v0.47/build/architecture/adr-019-protobuf-state-encoding#usage-of-any-to-encode-interfaces))
53+
- Create a more flexible, generic schema structure to hold a wide range of data formats (Can be used [Any](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/any.proto) as described in [ADR-19](https://docs.cosmos.network/sdk/v0.53/build/architecture/adr-019-protobuf-state-encoding#usage-of-any-to-encode-interfaces))
5454
- Migrate old states to the newer, generic schema.
5555
- Remove the states associated with the older schema versions.
5656
- Optioanlly can be implemented queries for requesting schemas with any return type
Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,42 @@
1-
# Mapping DCL Schemas to Matter Specification
1+
# Mapping DCL Entities to Matter Specification
22

3-
This document describes how DCL records and entities map to the CHIP/Matter [specification](https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/service_device_management/DistributedComplianceLedger.adoc#ref_DistributedComplianceLedger).
3+
This document describes how DCL records and entities map to the Matter [specification](https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/service_device_management/DistributedComplianceLedger.adoc#ref_DistributedComplianceLedger).
44

5-
In DCL, different schemas and respective endpoints are used for write(txn messages) and read(query calls) requests, but the CHIP/Matter specification describes only what was written and assumes that
6-
read requests are the same. To know about how write and read requests maps to spec please follow below sections for more details.
5+
In DCL, different schemas and respective endpoints are used for write (txn messages) and read (query calls) requests, but the Matter specification describes only what was written and assumes that read requests are the same. To know about how write and read requests map to spec, please follow the sections below for more details.
76

87
## PKI Module
98

10-
1. **Device Attestation (DA):** The Product Attestation Authority (PAA) and Intermediate (PAI) certificate [schemas](https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/service_device_management/DistributedComplianceLedger.adoc#ref_PAAAndPAICertificateSchema) correspond to the [DA certificate types section](transactions.md#x509-pki).
11-
2. **Operational Trust Anchors:** The [schemas](https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/service_device_management/DistributedComplianceLedger.adoc#5-operational-trust-anchors-schema) for Operational Certificates correspond to the [NOC certificate types section](transactions.md#x509-pki).
9+
1. DCL uses a single [Certificate](../proto/zigbeealliance/distributedcomplianceledger/pki/certificate.proto) entity for all(`PAA`,`PAI`,`RCAC` and `ICAC`) certificate types mentioned in the Matter specification.
10+
2. Associated `write/read` requests regarding the Product Attestation Authority (PAA) and Intermediate (PAI) certificate [schemas](https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/service_device_management/DistributedComplianceLedger.adoc#ref_PAAAndPAICertificateSchema) can be found in the [DA certificate types section](transactions.md#x509-pki).
11+
3. Associated `write/read` requests regarding the Operational Certificates [schemas](https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/service_device_management/DistributedComplianceLedger.adoc#5-operational-trust-anchors-schema) can be found in the [NOC certificate types section](transactions.md#x509-pki).
1212
* **Note:** DCL uses the terms **NOC** and **ICA**, which map to **RCAC** and **ICAC** in the Matter specification, respectively.
13-
3. **Unified Schema:** DCL uses a single [Certificate](../proto/zigbeealliance/distributedcomplianceledger/pki/certificate.proto) schema for all certificate types mentioned in the Matter specification.
14-
4. **Revocation:** Device Attestation PKI Revocation Distribution Points [schema](https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/service_device_management/DistributedComplianceLedger.adoc#9-device-attestation-pki-revocation-distribution-points-schema) are implemented within the PKI Module as described in the [revocation points section](transactions.md#x509-pki).
13+
4. Device Attestation PKI Revocation Distribution Points [schema](https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/service_device_management/DistributedComplianceLedger.adoc#9-device-attestation-pki-revocation-distribution-points-schema) correspond to [PKI Revocation Distribution Point](../proto/zigbeealliance/distributedcomplianceledger/pki/pki_revocation_distribution_point.proto) entity and the associated `write/read` requests can be found in the [revocation points section](transactions.md#x509-pki).
14+
15+
## Model Module
16+
17+
In DCL, the [Model module](transactions/model.md) is responsible to handle records regarding device and device software version models.
18+
19+
1. The [Device Model schema](https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/service_device_management/DistributedComplianceLedger.adoc#ref_DeviceModelSchema) corresponds to the [Model](../proto/zigbeealliance/distributedcomplianceledger/model/model.proto) entity, and the associated `write/read` requests can be found in the [Model and Model Version section](transactions.md#model-and-model-version).
20+
2. The [Device Software Version Model schema](https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/service_device_management/DistributedComplianceLedger.adoc#7-devicesoftwareversionmodel-schema) corresponds to the to [Model Version](../proto/zigbeealliance/distributedcomplianceledger/model/model_version.proto) entity, and the associated `write/read` requests can be found in the [Model and Model Version section](transactions.md#model-and-model-version).
21+
22+
## Compliance Module
23+
24+
In DCL, the [Compliance module](transactions/compliance.md) is responsible to handle certification status of particular software version(`Model Version` in DCL term) for given product(`Model` in DCL term).
25+
26+
Below is the list of notes to consider while mapping DCL Compliance module to Matter specification:
27+
1. The [Device Software Compliance schema](https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/service_device_management/DistributedComplianceLedger.adoc#8-devicesoftwarecompliance--compliance-test-result-schema) corresponds to the [Compliance Info](../proto/zigbeealliance/distributedcomplianceledger/compliance/compliance_info.proto) entity, and the associated `write/read` requests can be found in the [Compliance section](transactions.md#compliance)
28+
2. In DCL, specific endpoints are used (by CSA) to handle [certification status](https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/service_device_management/DistributedComplianceLedger.adoc#82-softwareversioncertificationstatusenum-type) of the device software version according to the provided `certificatType`(ZB/Matter):
29+
- [Provision](transactions/compliance.md#PROVISION_MODEL) endpoint is used to register that particular device software is in `provisional` (going into certification testing phase) state
30+
* **Note:** This endpoint **cannot** be used for device software versions that are already in `compliant` or `revoked` state
31+
- [Certify](transactions/compliance.md#CERTIFY_MODEL) endpoint is used to register that particular device software version is in `compliant` state
32+
* **Note:** This endpoint **can** be used for device software versions that are already in `provisional` or `revoked` state (e.g. re-certification)
33+
- [Revoke](transactions/compliance.md#REVOKE_MODEL_CERTIFICATION) endpoint is used to register that particular device software version is `revoked`
34+
* **Note:** This endpoint **can** be used for device software versions that are already in `provisional` or `compliant` state
35+
- [Update](transactions/compliance.md#UPDATE_COMPLIANCE_INFO) endpoint is used to update the additional-info/metadata of a particular device software version
36+
* **Note:** This endpoint **cannot** be used to change the certification status
37+
3. In DCL, there are several query endpoints can be used for specific reading purposes.
38+
- [Provisional Model](transactions/compliance.md#GET_PROVISIONAL_MODEL) can be used to retrieve/check the software version certification of particular device is in `provisional` state
39+
- [Certified Model](transactions/compliance.md#GET_CERTIFIED_MODEL) can be used to retrieve/check the software version certification of particular device in `compliant` state
40+
- [Revoked Model](transactions/compliance.md#GET_REVOKED_MODEL) can be used to retrieve/check the software version certification of particular device in `revoked` state
41+
- [Compliance Info](transactions/compliance.md#GET_COMPLIANCE_INFO) can be used to get the full compliance(including certification state) information of a particular device software version, bypassing state check query calls mentioned above
42+
- [Device Software Compliance](transactions/compliance.md#GET_DEVICE_SOFTWARE_COMPLIANCE) can be used to get all compliance records associated with [CD Certificate ID](https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/service_device_management/DistributedComplianceLedger.adoc#83-cdcertificateid)

docs/monitoring.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
As long as DCLedger is built on top of Cosmos SDK and Tendermint their monitoring abilities can be considered for DCLedger as well.
66

77
* Starting from `v0.21.0` Tendermint provides Prometheus compatible [metrics](https://docs.tendermint.com/v0.34/tendermint-core/metrics.html).
8-
* Starting from `v0.40.0` Cosmos SDK provides [telemetry](https://docs.cosmos.network/v0.45/core/telemetry.html) package as a server-side support for application performance and behavior explorations.
8+
* Starting from `v0.40.0` Cosmos SDK provides [telemetry](https://docs.cosmos.network/sdk/v0.47/learn/advanced/telemetry) package as a server-side support for application performance and behavior explorations.
99

1010
## Installation & Configuration
1111

docs/static/openapi.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8804,7 +8804,7 @@ paths:
88048804
enhancedSetupFlowTCFileSize:
88058805
type: integer
88068806
format: int64
8807-
maintenanceUrl:
8807+
enhancedSetupFlowMaintenanceUrl:
88088808
type: string
88098809
discoveryCapabilitiesBitmask:
88108810
type: integer
@@ -9058,7 +9058,7 @@ paths:
90589058
enhancedSetupFlowTCFileSize:
90599059
type: integer
90609060
format: int64
9061-
maintenanceUrl:
9061+
enhancedSetupFlowMaintenanceUrl:
90629062
type: string
90639063
discoveryCapabilitiesBitmask:
90649064
type: integer
@@ -23539,7 +23539,7 @@ definitions:
2353923539
enhancedSetupFlowTCFileSize:
2354023540
type: integer
2354123541
format: int64
23542-
maintenanceUrl:
23542+
enhancedSetupFlowMaintenanceUrl:
2354323543
type: string
2354423544
discoveryCapabilitiesBitmask:
2354523545
type: integer
@@ -23700,7 +23700,7 @@ definitions:
2370023700
enhancedSetupFlowTCFileSize:
2370123701
type: integer
2370223702
format: int64
23703-
maintenanceUrl:
23703+
enhancedSetupFlowMaintenanceUrl:
2370423704
type: string
2370523705
discoveryCapabilitiesBitmask:
2370623706
type: integer
@@ -23808,7 +23808,7 @@ definitions:
2380823808
enhancedSetupFlowTCFileSize:
2380923809
type: integer
2381023810
format: int64
23811-
maintenanceUrl:
23811+
enhancedSetupFlowMaintenanceUrl:
2381223812
type: string
2381323813
discoveryCapabilitiesBitmask:
2381423814
type: integer

0 commit comments

Comments
 (0)