Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(rust/cardano-chain-follower): Use CIP509 from rbac-registration #96

Merged
merged 12 commits into from
Dec 6, 2024

Conversation

bkioshn
Copy link
Contributor

@bkioshn bkioshn commented Dec 4, 2024

Description

Remove CIP509 from cardano-chain-follower and use CIP509 from rbac-registration lib instead

Related Issue(s)

Closes #94

Breaking Changes

Existing code that use CIP509 from cardano-chain-follower should change to CIP509 from rbac-registration

Test results

Data generated from cardano-chain-folower example

  1. The old registration post on chain should failed, since the structure of CIP509 changes
    https://preprod.cardanoscan.io/block/2929893
  2024-12-06T14:45:26.369047Z  INFO follow_chains: Block Number 2929893
    at cardano-chain-follower/examples/follow_chains.rs:372 on tokio-runtime-worker ThreadId(3)

  2024-12-06T14:45:26.369049Z  INFO follow_chains: CIP509 0: Cip509Validation { is_valid_txn_inputs_hash: false, is_valid_aux: false, is_valid_stake_public_key: false, is_valid_payment_key: false, is_valid_signing_key: false, additional_data: AdditionalData { precomputed_aux: [] } }, chain: "Preprod"
    at cardano-chain-follower/examples/follow_chains.rs:375 on tokio-runtime-worker ThreadId(3)

  2024-12-06T14:45:26.369051Z  WARN follow_chains: CIP509 0: ["Failed to decode CIP509 metadata: decode error: Failed to decode decode error: Invalid x509 certificate"], chain: "Preprod"
  1. New data block 2945334, should pass the validation and log the information
    https://preprod.cardanoscan.io/block/2945334
  2024-12-06T14:45:26.628108Z  INFO follow_chains: Block Number 2945334
    at cardano-chain-follower/examples/follow_chains.rs:372 on tokio-runtime-worker ThreadId(7)

  2024-12-06T14:45:26.628115Z  INFO follow_chains: CIP509 3: Cip509Validation { is_valid_txn_inputs_hash: true, is_valid_aux: true, is_valid_stake_public_key: true, is_valid_payment_key: true, is_valid_signing_key: true, additional_data: AdditionalData { precomputed_aux: [161, 25, 1, 253, 164, 0, 80, 202, 122, 20, 87, 239, 159, 76, 127, 156, 116, 127, 140, 74, 76, 250, 108, 1, 80, 209, 39, 38, 91, 108, 32, 36, 191, 126, 37, 69, 113, 188, 228, 31, 167, 11, 135, 88, 64, 27, 63, 2, 0, 100, 64, 79, 43, 143, 194, 43, 57, 25, 96, 95, 184, 108, 185, 211, 199, 87, 60, 229, 143, 250, 237, 183, 22, 81, 123, 160, 2, 10, 185, 22, 37, 16, 120, 106, 129, 100, 55, 35, 254, 82, 151, 218, 198, 249, 109, 208, 128, 3, 44, 96, 16, 113, 16, 250, 47, 231, 221, 181, 112, 88, 64, 24, 20, 6, 67, 66, 42, 49, 225, 205, 226, 72, 20, 92, 200, 197, 95, 92, 83, 2, 43, 142, 70, 193, 77, 16, 40, 42, 136, 2, 6, 208, 128, 3, 60, 193, 189, 56, 43, 29, 81, 82, 90, 98, 33, 11, 105, 113, 105, 73, 41, 75, 99, 5, 133, 40, 149, 146, 140, 130, 247, 183, 60, 199, 12, 88, 64, 47, 125, 21, 92, 3, 226, 171, 249, 253, 148, 214, 226, 59, 65, 245, 206, 87, 245, 149, 200, 250, 255, 22, 254, 137, 154, 190, 43, 254, 120, 216, 57, 208, 155, 144, 168, 127, 205, 150, 245, 95, 251, 207, 201, 150, 116, 252, 90, 57, 40, 150, 112, 60, 235, 143, 250, 203, 107, 25, 59, 235, 27, 217, 168, 88, 64, 92, 148, 244, 226, 222, 109, 0, 26, 197, 129, 58, 113, 160, 58, 150, 44, 20, 8, 160, 88, 28, 40, 0, 9, 62, 17, 45, 147, 145, 103, 144, 156, 174, 45, 106, 248, 253, 8, 128, 146, 149, 212, 160, 75, 54, 10, 115, 113, 20, 226, 200, 212, 193, 215, 79, 81, 76, 204, 193, 217, 57, 80, 44, 104, 88, 64, 158, 106, 199, 205, 71, 36, 66, 2, 131, 228, 131, 197, 131, 130, 28, 164, 194, 20, 194, 220, 21, 196, 189, 157, 101, 130, 253, 3, 253, 165, 220, 66, 2, 195, 157, 165, 229, 229, 2, 131, 221, 37, 3, 188, 3, 188, 100, 93, 2, 125, 61, 3, 156, 92, 92, 165, 67, 220, 2, 31, 253, 141, 52, 123, 88, 64, 139, 113, 109, 173, 54, 61, 43, 55, 118, 210, 127, 195, 172, 178, 166, 61, 31, 153, 212, 157, 255, 254, 188, 165, 38, 197, 24, 186, 49, 23, 135, 195, 12, 151, 115, 47, 119, 176, 78, 40, 68, 199, 195, 197, 170, 139, 253, 205, 82, 109, 62, 130, 45, 164, 213, 122, 186, 53, 177, 92, 20, 69, 207, 10, 87, 156, 197, 35, 205, 217, 155, 183, 161, 119, 6, 26, 33, 16, 40, 136, 131, 192, 217, 113, 206, 191, 234, 0, 24, 99, 88, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] } }, chain: "Preprod"

Please confirm the following checks

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream module

Signed-off-by: bkioshn <bkioshn@gmail.com>
Signed-off-by: bkioshn <bkioshn@gmail.com>
Signed-off-by: bkioshn <bkioshn@gmail.com>
Signed-off-by: bkioshn <bkioshn@gmail.com>
Signed-off-by: bkioshn <bkioshn@gmail.com>
@bkioshn bkioshn marked this pull request as draft December 4, 2024 07:28
Copy link
Contributor

github-actions bot commented Dec 4, 2024

Test Report | ${\color{lightgreen}Pass: 230/230}$ | ${\color{red}Fail: 0/230}$ |

Signed-off-by: bkioshn <bkioshn@gmail.com>
@stevenj stevenj added the enhancement New feature or request label Dec 4, 2024
@bkioshn bkioshn marked this pull request as ready for review December 4, 2024 09:36
@bkioshn bkioshn marked this pull request as draft December 4, 2024 10:22
bkioshn and others added 6 commits December 4, 2024 17:24
Signed-off-by: bkioshn <bkioshn@gmail.com>
Signed-off-by: bkioshn <bkioshn@gmail.com>
Signed-off-by: bkioshn <bkioshn@gmail.com>
Signed-off-by: bkioshn <bkioshn@gmail.com>
Signed-off-by: bkioshn <bkioshn@gmail.com>
@bkioshn bkioshn marked this pull request as ready for review December 6, 2024 14:58
Copy link
Collaborator

@stevenj stevenj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@stevenj stevenj merged commit e5a2fd1 into main Dec 6, 2024
22 of 24 checks passed
@stevenj stevenj deleted the fix/chain-follower-cip509 branch December 6, 2024 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

🛠️ [TASK] : Refactor CIP509 in cardano-chain-follower to use the CIP509 in rbac-registration lib
2 participants