DATU Accountability Enforcement with Smart Contract Enablement#14
Conversation
…s validator model, and IPFS-powered data registry map onto the DATU reference architecture and detailed the changes needed across consensus, modules, data anchoring, governance, application, and security layers to reach feature parity
…rint a skip message when secrets are absent, and guard the scan and quality gate steps so they only run when both the token and host URL are available.
… so the workflow can run successfully
…ials, skip analysis when secrets are unavailable, and pass both the token and host URL when present to prevent scanner failures.
…plicit mapping and clarified how to add optional local variables without breaking schema validation.
…ne while having my local sonarqube setup
…rk supplies one, so the upstream pipeline keeps using the key in sonar-project.properties.
…r, DisbursementTracker, AccountabilityScores, and GovernanceVoting—with placeholder AppModule definitions to prepare for future Cosmos SDK wiring. Added baseline genesis structures and key-prefix helpers for each new module so state initialization and store wiring can evolve alongside the DATU roadmap.
…ITM-focused title, key talking points, and testing notes for the genesis poisoning documentation updates.
… parameter validation to stage smart contract metadata for future DATU capabilities. Wired the wasm module into the application by exposing its keeper and updating module account permissions, blocked addresses, and lifecycle ordering in the runtime configuration.
… procurements, disbursements, accountability scores, and delegated governance relationships to capture the DATU module semantics. Implemented keepers that persist state via JSON-backed collections, allocate sequence-based identifiers, enforce cross-module invariants, and expose genesis import/export helpers for each new module. Added unit tests that exercise registration flows, lifecycle transitions, and edge conditions across the budget, procurement, disbursement, accountability, and governance modules.
…ed smart contract reference, exercising register, update, query, walk, and total operations end-to-end. Documented how to run the DATU module operation example for reuse in future integration testing. Switched the WASM keeper to JSON value codecs and ensured contract IDs advance correctly when registering new smart contracts.
… capture signer addresses, scorecard references, and signature URIs for DATU workflows. Extended the budget registry to require liability contract URIs, track approval records, and validate them against accountability keeper scorecards before status changes. Applied the same multi-party approval enforcement to the procurement and disbursement trackers so contract transitions only succeed when distinct, high-scoring signers have endorsed them. Updated keeper unit tests and the DATU workflow example to create scorecards, record approvals, and exercise the guarded transitions end-to-end
… capture signer addresses, scorecard references, and signature URIs for DATU workflows. Extended the budget registry to require liability contract URIs, track approval records, and validate them against accountability keeper scorecards before status changes. Applied the same multi-party approval enforcement to the procurement and disbursement trackers so contract transitions only succeed when distinct, high-scoring signers have endorsed them. Updated keeper unit tests and the DATU workflow example to create scorecards, record approvals, and exercise the guarded transitions end-to-end
…baseline schema so DATU accountability upgrades no longer introduce liability approval fields into the datasets module. Regenerated the dataset pb.go types so the generated structs again expose only the original dataset fields. Updated the reusable PR description document with an explicit title while keeping the summary focused on the DATU scaffolding and smart contract enablement narrative.
There was a problem hiding this comment.
Pull Request Overview
This PR integrates accountability enforcement and smart contract capabilities into the DATU financial workflow by scaffolding new modules and extending existing ones with approval mechanisms. The changes enable on-chain liability contracts, multi-party endorsements with scorecard validation, and smart contract registration to support budget, procurement, and disbursement lifecycle management.
Key changes:
- Scaffolded accountability scores, budget registry, procurement ledger, disbursement tracker, governance voting, and wasm modules with keeper implementations
- Added approval workflow enforcement requiring liability contract URIs and accountability score validation across financial modules
- Implemented comprehensive end-to-end test demonstrating the complete DATU workflow with smart contract integration
Reviewed Changes
Copilot reviewed 80 out of 80 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| x/wasm/types/*.go | Type definitions, parameters, keys, and error handling for the wasm module |
| x/wasm/keeper/*.go | Keeper implementation for smart contract registration and retrieval |
| x/wasm/module/*.go | Module registration and depinject wiring for the wasm module |
| x/accountabilityscores/types/*.go | Scorecard and approval type definitions with validation logic |
| x/accountabilityscores/keeper/*.go | Keeper implementation for managing accountability scorecards |
| x/accountabilityscores/module/*.go | Module registration and depinject wiring |
| x/budgetregistry/types/*.go | Budget type definitions with status transitions and approval tracking |
| x/budgetregistry/keeper/*.go | Keeper implementing budget registration and approval validation |
| x/procurementledger/types/*.go | Procurement type definitions with liability contract requirements |
| x/procurementledger/keeper/*.go | Keeper enforcing procurement approval workflows |
| x/disbursementtracker/types/*.go | Disbursement type definitions with approval tracking |
| x/disbursementtracker/keeper/*.go | Keeper managing disbursement approvals and totals |
| x/governancevoting/types/*.go | Delegation type definitions for governance workflows |
| x/governancevoting/keeper/*.go | Keeper managing delegation relationships |
| x/datasets/types/*.pb.go | Import statement reordering in generated protobuf files |
| proto/govchain/*/module.proto | Protobuf definitions for module configuration |
| documentation/datu_examples/* | Comprehensive integration test and documentation |
| app/app_config.go, app/app.go | Application-level wiring for new modules |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| --- x/wasm/types/module.pb.go | ||
| +++ x/wasm/types/module.pb.go | ||
| @@ -0,0 +1,322 @@ | ||
| +// Code generated by protoc-gen-gogo. DO NOT EDIT. | ||
| +// source: govchain/wasm/module/v1/module.proto | ||
| + | ||
| +package types | ||
| + | ||
| +import ( | ||
| + _ "cosmossdk.io/depinject/appconfig/v1alpha1" | ||
| + fmt "fmt" | ||
| + proto "github.com/cosmos/gogoproto/proto" | ||
| + io "io" | ||
| + math "math" | ||
| + math_bits "math/bits" | ||
| +) | ||
| + | ||
| +// Reference imports to suppress errors if they are not otherwise used. | ||
| +var _ = proto.Marshal | ||
| +var _ = fmt.Errorf | ||
| +var _ = math.Inf | ||
| + | ||
| +// This is a compile-time assertion to ensure that this generated file | ||
| +// is compatible with the proto package it is being compiled against. | ||
| +// A compilation error at this line likely means your copy of the | ||
| +// proto package needs to be updated. | ||
| +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package | ||
| + | ||
| +// Module is the config object for the wasm module. | ||
| +type Module struct { | ||
| + // authority defines the custom module authority. | ||
| + // If not set, defaults to the governance module. | ||
| + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` | ||
| +} | ||
| + | ||
| +func (m *Module) Reset() { *m = Module{} } | ||
| +func (m *Module) String() string { return proto.CompactTextString(m) } |
There was a problem hiding this comment.
This appears to be a rejected patch file (.rej) that should not be committed to the repository. Patch rejection files are artifacts from failed merge attempts and should be excluded from version control.
| --- x/wasm/types/module.pb.go | |
| +++ x/wasm/types/module.pb.go | |
| @@ -0,0 +1,322 @@ | |
| +// Code generated by protoc-gen-gogo. DO NOT EDIT. | |
| +// source: govchain/wasm/module/v1/module.proto | |
| + | |
| +package types | |
| + | |
| +import ( | |
| + _ "cosmossdk.io/depinject/appconfig/v1alpha1" | |
| + fmt "fmt" | |
| + proto "github.com/cosmos/gogoproto/proto" | |
| + io "io" | |
| + math "math" | |
| + math_bits "math/bits" | |
| +) | |
| + | |
| +// Reference imports to suppress errors if they are not otherwise used. | |
| +var _ = proto.Marshal | |
| +var _ = fmt.Errorf | |
| +var _ = math.Inf | |
| + | |
| +// This is a compile-time assertion to ensure that this generated file | |
| +// is compatible with the proto package it is being compiled against. | |
| +// A compilation error at this line likely means your copy of the | |
| +// proto package needs to be updated. | |
| +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package | |
| + | |
| +// Module is the config object for the wasm module. | |
| +type Module struct { | |
| + // authority defines the custom module authority. | |
| + // If not set, defaults to the governance module. | |
| + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` | |
| +} | |
| + | |
| +func (m *Module) Reset() { *m = Module{} } | |
| +func (m *Module) String() string { return proto.CompactTextString(m) } | |
| # (Delete the entire file) |
| // Code generated by protoc-gen-gogo. DO NOT EDIT. | ||
| // source: govchain/wasm/module/v1/module.proto | ||
|
|
||
| package types | ||
|
|
||
| import ( | ||
| _ "cosmossdk.io/api/cosmos/app/v1alpha1" | ||
| fmt "fmt" | ||
| proto "github.com/cosmos/gogoproto/proto" | ||
| io "io" | ||
| math "math" | ||
| math_bits "math/bits" | ||
| ) | ||
|
|
||
| // Reference imports to suppress errors if they are not otherwise used. | ||
| var _ = proto.Marshal | ||
| var _ = fmt.Errorf | ||
| var _ = math.Inf | ||
|
|
||
| // This is a compile-time assertion to ensure that this generated file | ||
| // is compatible with the proto package it is being compiled against. | ||
| // A compilation error at this line likely means your copy of the | ||
| // proto package needs to be updated. | ||
| const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package | ||
|
|
||
| // Module is the config object for the module. | ||
| type Module struct { | ||
| // authority defines the custom module authority. | ||
| // If not set, defaults to the governance module. | ||
| Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` | ||
| } | ||
|
|
||
| func (m *Module) Reset() { *m = Module{} } | ||
| func (m *Module) String() string { return proto.CompactTextString(m) } | ||
| func (*Module) ProtoMessage() {} | ||
| func (*Module) Descriptor() ([]byte, []int) { | ||
| return fileDescriptor_9845709267c03ccf, []int{0} | ||
| } | ||
| func (m *Module) XXX_Unmarshal(b []byte) error { | ||
| return m.Unmarshal(b) | ||
| } | ||
| func (m *Module) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
| if deterministic { | ||
| return xxx_messageInfo_Module.Marshal(b, m, deterministic) | ||
| } else { | ||
| b = b[:cap(b)] | ||
| n, err := m.MarshalToSizedBuffer(b) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| return b[:n], nil | ||
| } | ||
| } | ||
| func (m *Module) XXX_Merge(src proto.Message) { | ||
| xxx_messageInfo_Module.Merge(m, src) | ||
| } |
There was a problem hiding this comment.
This .orig file appears to be a backup file from a merge conflict or patch operation and should not be committed to the repository. Only the final generated protobuf file should be tracked in version control.
| // Code generated by protoc-gen-gogo. DO NOT EDIT. | |
| // source: govchain/wasm/module/v1/module.proto | |
| package types | |
| import ( | |
| _ "cosmossdk.io/api/cosmos/app/v1alpha1" | |
| fmt "fmt" | |
| proto "github.com/cosmos/gogoproto/proto" | |
| io "io" | |
| math "math" | |
| math_bits "math/bits" | |
| ) | |
| // Reference imports to suppress errors if they are not otherwise used. | |
| var _ = proto.Marshal | |
| var _ = fmt.Errorf | |
| var _ = math.Inf | |
| // This is a compile-time assertion to ensure that this generated file | |
| // is compatible with the proto package it is being compiled against. | |
| // A compilation error at this line likely means your copy of the | |
| // proto package needs to be updated. | |
| const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package | |
| // Module is the config object for the module. | |
| type Module struct { | |
| // authority defines the custom module authority. | |
| // If not set, defaults to the governance module. | |
| Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` | |
| } | |
| func (m *Module) Reset() { *m = Module{} } | |
| func (m *Module) String() string { return proto.CompactTextString(m) } | |
| func (*Module) ProtoMessage() {} | |
| func (*Module) Descriptor() ([]byte, []int) { | |
| return fileDescriptor_9845709267c03ccf, []int{0} | |
| } | |
| func (m *Module) XXX_Unmarshal(b []byte) error { | |
| return m.Unmarshal(b) | |
| } | |
| func (m *Module) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | |
| if deterministic { | |
| return xxx_messageInfo_Module.Marshal(b, m, deterministic) | |
| } else { | |
| b = b[:cap(b)] | |
| n, err := m.MarshalToSizedBuffer(b) | |
| if err != nil { | |
| return nil, err | |
| } | |
| return b[:n], nil | |
| } | |
| } | |
| func (m *Module) XXX_Merge(src proto.Message) { | |
| xxx_messageInfo_Module.Merge(m, src) | |
| } | |
| # (Delete the file entirely; no replacement lines.) |
| if _, err := k.addressCodec.StringToBytes(delegation.Delegatee); err != nil { | ||
| return types.Delegation{}, fmt.Errorf("%w: %v", types.ErrDelegationInvalidAddr, err) | ||
| } | ||
| if delegation.Active == false { |
There was a problem hiding this comment.
[nitpick] Explicit comparison with false is redundant. Use if !delegation.Active for more idiomatic Go code.
| if delegation.Active == false { | |
| if !delegation.Active { |
Summary
Implementation Notes
app/app.goandapp/app_config.goto include the accountability and wasm keepers in the runtime wiring, begin/end blockers, and module account permissions.x/budgetregistry,x/procurementledger, andx/disbursementtrackerto enforce liability contracts, approval thresholds, and accountability score lookups prior to status promotions.documentation/datu_examples/full_workflow_test.goto bootstrap mock modules, register a treasury coordination contract, publish accountability scorecards, and demonstrate compliant approvals across the budget pipeline.