chore: make extra signers auditable in dlog metadata#1600
chore: make extra signers auditable in dlog metadata#1600SurbhiAgarwal1 wants to merge 3 commits into
Conversation
c978424 to
4e434b2
Compare
|
Hi @SurbhiAgarwal1 , thanks for the effort 🙏 The PR is interesting cause it introduces a breaking point with metadata marshaled with the previous definition.
Around the end of the year, we will need to stop introducing these breaking changes and make the protocol evolve following versioning. |
| repeated OutputMetadata outputs = 2; // Outputs | ||
| repeated Identity extra_signers = 8; // Additional signers for the transfer | ||
| repeated AuditableIdentity extra_signers = 8; // Additional signers for the transfer | ||
| Identity issuer = 3; // Issuer signer for the redeem transfer |
There was a problem hiding this comment.
also this one needs to be auditable
| repeated TransferInputMetadata inputs = 1; // Inputs | ||
| repeated OutputMetadata outputs = 2; // Outputs | ||
| repeated Identity extra_signers = 8; // Additional signers for the transfer | ||
| repeated AuditableIdentity extra_signers = 8; // Additional signers for the transfer |
There was a problem hiding this comment.
ops, we need to fix the numbers here
|
Hi @SurbhiAgarwal1 , okay, there was a bug in the definition of the protobuf as well. I left a comment on that. So, actually, there is way to modify the protobuf without introducing a break with old generated messages. message ActionMetadata {
oneof Metadata { // Oneof field containing either issue or transfer metadata
IssueMetadata issue_metadata = 1; // Issue action metadata
TransferMetadata transfer_metadata = 2; // Transfer action metadata
}
}This structure allows to introduce two new protobuf messages IssueMetadataV3 and TransferMetadataV3 with the right fields. Then, in the code, we have to make sure we handle all the versions. I say V3 becasue we have already in What do you think? Would you like to explore this retro-compatible extension Thanks for your effort 🙏 |
|
Hi @SurbhiAgarwal1 , I think we are going in the right direction. Thanks for the effort so far 🙏 |
|
Hey @adecaro, thanks a lot for the detailed guidance — this really helped clarify the right direction 👍 I agree that introducing a V3 metadata layer using the existing Regarding the regression testing pipeline — that makes complete sense. I’ll work on a separate PR to:
I’ll also address the current failing checks (lint, tests, proto issues) and make sure everything passes locally before pushing updates. Thanks again for the guidance — I’ll proceed with the regression test PR next and keep this one aligned with the V3-compatible approach 🙏 |
…perledger-labs#1600 Signed-off-by: SurbhiAgarwal1 <agarwalsurbhi1807@gmail.com>
df3c9da to
f1a98e3
Compare
…rledger-labs#1600 Signed-off-by: SurbhiAgarwal1 <agarwalsurbhi1807@gmail.com>
…r-labs#1600 Signed-off-by: SurbhiAgarwal1 <agarwalsurbhi1807@gmail.com>
Signed-off-by: SurbhiAgarwal1 <agarwalsurbhi1807@gmail.com>
…yperledger-labs#1600 Signed-off-by: SurbhiAgarwal1 <agarwalsurbhi1807@gmail.com>
…perledger-labs#1600 Signed-off-by: SurbhiAgarwal1 <agarwalsurbhi1807@gmail.com>
…labs#1600 Signed-off-by: SurbhiAgarwal1 <agarwalsurbhi1807@gmail.com>
ab7a3aa to
a9dbdad
Compare
In both IssueMetadata and TransferMetadata, the ExtraSigners field was typed as []Identity. This created an auditability gap - any third party with access to the metadata could not resolve or audit these identities, unlike Issuer, Senders, and Receivers which already carry full AuditableIdentity (identity + audit info). - Change ExtraSigners to []*AuditableIdentity in both IssueMetadata and TransferMetadata - Add V3 metadata proto types (IssueMetadataV3, TransferMetadataV3) with AuditableIdentity for ExtraSigners and Issuer - Add ProtocolV3 constant and backward-compatible FromProtos/ToProtos - Add SetMinProtocolVersion to Validator interface for protocol enforcement - Add regression tests for V1/V2/V3 metadata serialization - Fix lint errors: remove wastedassign, fix import grouping, fix integer conversion in getVersion() Closes hyperledger-labs#993 Signed-off-by: SurbhiAgarwal1 <agarwalsurbhi1807@gmail.com>
a9dbdad to
b3cf3b9
Compare
Signed-off-by: SurbhiAgarwal1 <agarwalsurbhi1807@gmail.com>
|
Hi @adecaro 👋 The Tests / utest (unit-tests-race) check is failing, but after investigating I believe it is not related to this PR's changes. The failure is in integration/nwo/txgen packages which have no connection to the changes in this PR. None of the failing packages import or use any of the modified code (ExtraSigners, AuditableIdentity, ProtocolV3, metadata serialization). Could you please confirm if this is a known flaky test, or advise if there is something specific I should look into? Happy to re-run the job if needed. All other checks are now passing:
|
|
Hi @SurbhiAgarwal1 , I believe we can close this issue for now. This was very helpful to reflect on the current issues around the protobuf that culminated in #1622. I would like to ask you an additional follow up: Please, could you check if we really need the Identity field in type AuditableIdentity struct {
Identity Identity
AuditInfo []byte
}I believe we have it there just to simplify the code. Indeed, we need to make sure it matches the corresponding identity in the action. But, do we really need it? If there is a way to remove it, better to have something that is as lean as possible. What do you think? |
|
Hi @SurbhiAgarwal1 , I'll absorb this PR into #1622 . Therefore, I'll close this PR if it is okay with you. Thanks for the understanding and for triggering a full revision of the protobuf. Thanks much 🙏 |
Closes #993
Problem
In both
IssueMetadataandTransferMetadata, theExtraSignersfield was typed as
[]Identity. This created an auditability gap —any third party with access to the metadata could not resolve or audit
these identities, unlike
Issuer,Senders, andReceiverswhichalready carry full
AuditableIdentity(identity + audit info).Solution
Replace
ExtraSigners []IdentitywithExtraSigners []*AuditableIdentityin both metadata structs, bringing them in line with every other
identity field in the same file.
Changes
token/driver/protos/request.protorepeated Identity extra_signers→repeated AuditableIdentity extra_signersin bothTransferMetadataandIssueMetadatatoken/driver/protos-go/request/request.pb.gotoken/driver/request.goExtraSigners []Identity→[]*AuditableIdentity; updateToProtos/FromProtosto useprotos.ToProtosSlice/FromProtosSlice, consistent with other auditable fieldstoken/request.go.Identitywhen building publicIssue/Transferstructs (which keep[]Identityas their public API); fix extra-signer binding loop to useeid.Identitytoken/metadata.goMatch()comparisons to compare againstes.Identitytoken/driver/request_test.go,token/metadata_test.go,token/request_test.go[]*AuditableIdentityTesting
go test ./token/driver/...— PASSgo test ./token/...— PASSgo build ./token/...— cleango build ./token/core/...— cleanNotes
Issue.ExtraSignersandTransfer.ExtraSignersAPIs remain[]Identity— only the internal metadata layer changes