Skip to content

fix(core): correct DAO claim epoch boundary - #516

Merged
Hanssen0 merged 1 commit into
ckb-devrel:devfrom
Hanssen0:fix/epoch-calc
Sep 5, 2026
Merged

fix(core): correct DAO claim epoch boundary#516
Hanssen0 merged 1 commit into
ckb-devrel:devfrom
Hanssen0:fix/epoch-calc

Conversation

@Hanssen0

@Hanssen0 Hanssen0 commented Sep 5, 2026

Copy link
Copy Markdown
Member

Related to #514

@netlify

netlify Bot commented Sep 5, 2026

Copy link
Copy Markdown

Deploy Preview for appccc ready!

Name Link
🔨 Latest commit ccc3eba
🔍 Latest deploy log https://app.netlify.com/projects/appccc/deploys/6a9c88e4b298e500086f2e02
😎 Deploy Preview https://deploy-preview-516--appccc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 36 (🔴 down 48 from production)
Accessibility: 97 (no change from production)
Best Practices: 92 (🔴 down 8 from production)
SEO: 97 (🟢 up 9 from production)
PWA: -
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@changeset-bot

changeset-bot Bot commented Sep 5, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ccc3eba

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 20 packages
Name Type
@ckb-ccc/core Patch
@ckb-ccc/did-ckb Patch
@ckb-ccc/eip6963 Patch
@ckb-ccc/joy-id Patch
@ckb-ccc/lumos-patches Patch
@ckb-ccc/nip07 Patch
@ckb-ccc/okx Patch
@ckb-ccc/rei Patch
@ckb-ccc/shell Patch
@ckb-ccc/spore Patch
@ckb-ccc/ssri Patch
@ckb-ccc/type-id Patch
@ckb-ccc/udt Patch
@ckb-ccc/uni-sat Patch
@ckb-ccc/utxo-global Patch
@ckb-ccc/xverse Patch
@ckb-ccc/ccc Patch
ckb-ccc Patch
@ckb-ccc/connector Patch
@ckb-ccc/connector-react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify

netlify Bot commented Sep 5, 2026

Copy link
Copy Markdown

Deploy Preview for apiccc ready!

Name Link
🔨 Latest commit ccc3eba
🔍 Latest deploy log https://app.netlify.com/projects/apiccc/deploys/6a9c88e48583d70008117cb4
😎 Deploy Preview https://deploy-preview-516--apiccc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 84 (🔴 down 7 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 95 (no change from production)
PWA: -
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: a2970ba2-fe41-4785-a338-df5d7f9116cc

📥 Commits

Reviewing files that changed from the base of the PR and between 9d1aa1f and a26cb78.

📒 Files selected for processing (2)
  • packages/core/src/ckb/transaction.test.ts
  • packages/core/src/ckb/transaction.ts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • Corrected DAO claim epoch calculations when deposit and withdrawal epoch fractions are exactly equal.
    • Withdrawals in this boundary case now use the current epoch instead of being delayed by an additional cycle.
  • Tests
    • Added coverage to verify the corrected epoch calculation behavior.

Walkthrough

calcDaoClaimEpoch now keeps the current withdrawal epoch when deposit and withdrawal fractions are equal. A test constructs matching synthetic headers and verifies the returned epoch values.

Changes

DAO claim epoch calculation

Layer / File(s) Summary
Equal-fraction claim epoch handling
packages/core/src/ckb/transaction.ts, packages/core/src/ckb/transaction.test.ts
The comparison in calcDaoClaimEpoch changed from <= to <. A test verifies that equal fractions return withdrawal epoch 185n, 900n, 1800n without adding a cycle.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to a26cb

Equal-fraction DAO claims now remain eligible in the current withdrawal epoch, with coverage for the corrected boundary behavior. No current merge-blocking risk is identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: correcting the DAO claim epoch boundary in the core package.
Description check ✅ Passed The description includes the required contributing-guidelines confirmation and provides related issue context. It satisfies the repository template.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@netlify

netlify Bot commented Sep 5, 2026

Copy link
Copy Markdown

Deploy Preview for liveccc ready!

Name Link
🔨 Latest commit ccc3eba
🔍 Latest deploy log https://app.netlify.com/projects/liveccc/deploys/6a9c88e4a256f200089d3539
😎 Deploy Preview https://deploy-preview-516--liveccc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 10 (🔴 down 31 from production)
Accessibility: 88 (no change from production)
Best Practices: 92 (🔴 down 8 from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Sep 5, 2026

Copy link
Copy Markdown

Deploy Preview for docsccc ready!

Name Link
🔨 Latest commit ccc3eba
🔍 Latest deploy log https://app.netlify.com/projects/docsccc/deploys/6a9c88e4b298e500086f2e04
😎 Deploy Preview https://deploy-preview-516--docsccc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 77 (🔴 down 11 from production)
Accessibility: 95 (no change from production)
Best Practices: 92 (🔴 down 8 from production)
SEO: 75 (no change from production)
PWA: -
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@Hanssen0
Hanssen0 merged commit 1c74033 into ckb-devrel:dev Sep 5, 2026
17 of 18 checks passed
@Hanssen0
Hanssen0 deleted the fix/epoch-calc branch September 5, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant