-
Notifications
You must be signed in to change notification settings - Fork 21
fix(ledger): consistently use PoolKeyHash for certificates #1251
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
Conversation
|
Warning Rate limit exceeded@wolf31o2 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 4 minutes and 51 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR refactors certificate type definitions in Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
ledger/common/certs.go (1)
954-968: Fix PoolKeyhash encoding to match utxorpc specification and correct pattern.The code incorrectly encodes multiple data types (version byte + PoolKeyHash + DRep) into the
PoolKeyhashfield at lines 954-957. According to utxorpc specification, PoolKeyhash should be a raw byte field containing only the stake-pool identifier: the Blake2b-224 hash (28 bytes).The correct implementation pattern is shown in
StakeRegistrationDelegationCertificate.Utxorpc()(line 1010), which correctly assigns:PoolKeyhash: c.PoolKeyHash[:]The DRep data is already correctly passed to the separate
Drepfield on line 968, so remove the custom encoding and use the raw pool key hash directly.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
ledger/common/certs.go(4 hunks)
🔇 Additional comments (2)
ledger/common/certs.go (2)
1011-1011: Correct slice conversion for typed PoolKeyHash.The slice conversion
c.PoolKeyHash[:]correctly handles the change from[]byteto the typedPoolKeyHash, consistent with other certificate implementations.
983-983: Type change verified - all usages compatible.The change from
[]bytetoPoolKeyHash(a[28]bytearray type alias) is correctly implemented. All downstream consumers properly use slice conversion syntax[:]when accessing the field, making the type change safe and consistent across the codebase.
Signed-off-by: Chris Gianelloni <wolf31o2@blinklabs.io>
bb3b144 to
1aef9c3
Compare
Summary by CodeRabbit