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

Don't account for cell dep for MAX_ANCESTORS_COUNT #4315

Merged

Conversation

chenyukang
Copy link
Collaborator

@chenyukang chenyukang commented Jan 22, 2024

What problem does this PR solve?

We met a scenario that a cell dep may have many transactions as descendants, and we can not submit a new transaction to consume the dep cell.

Problem Summary:

What is changed and how it works?

cell dep should be handled specially when calculating the entry's ancestors_count.
In this PR, we add a direct_ancestors_count to store the directed parent-child relationship between transactions.

This is a short-term solution.

What's Changed:

Related changes

  • PR to update owner/repo:
  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code ci-runs-only: [ quick_checks,linters ]

Side effects

  • Performance regression
  • Breaking backward compatibility

Release note

Title Only: Include only the PR title in the release note.

@chenyukang chenyukang requested a review from a team as a code owner January 22, 2024 11:21
@chenyukang chenyukang requested review from doitian and removed request for a team January 22, 2024 11:21
@chenyukang chenyukang force-pushed the yukang-fix-celldep-limit branch 2 times, most recently from ff5782c to 08b362c Compare January 24, 2024 10:49
@chenyukang chenyukang changed the title [WIP] Don't account for cell dep for MAX_ANCESTORS_COUNT Don't account for cell dep for MAX_ANCESTORS_COUNT Jan 24, 2024
@chenyukang chenyukang force-pushed the yukang-fix-celldep-limit branch from 08b362c to a0290f5 Compare January 24, 2024 11:22
@chenyukang chenyukang force-pushed the yukang-fix-celldep-limit branch from fb784c0 to 4f661a7 Compare January 24, 2024 13:23
@zhangsoledad zhangsoledad added this pull request to the merge queue Jan 25, 2024
@@ -184,7 +184,8 @@ fn test_send_transaction_exceeded_maximum_ancestors_count() {
});
}

// the default value of pool config `max_ancestors_count` is 125, only 125 txs will be added to committed list of the block template
// the default value of pool config `max_ancestors_count` is 125,
Copy link
Collaborator

@eval-exec eval-exec Jan 25, 2024

Choose a reason for hiding this comment

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

But I found:
https://github.com/nervosnetwork/ckb/blob/4851b307b018b6bc86d2f79632223c97364f53c6/resource/ckb.toml#L140-L139

the max_ancestors_count in default config is 25, but DEFAULT_MAX_ANCESTORS_COUNT is 125.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think we can change the parameter in ckb.toml to 125 later.

Copy link
Member

Choose a reason for hiding this comment

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

I think it's a comment error, we should change the default const value to 25 also.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we change const DEFAULT_MAX_ANCESTORS_COUNT: usize to 25 too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it should be 125?

max_ancestors_count: cmp::max(DEFAULT_MAX_ANCESTORS_COUNT, max_ancestors_count),

25 is originally referred from bitcoin, we use 125.

Copy link
Collaborator

@eval-exec eval-exec Jan 25, 2024

Choose a reason for hiding this comment

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

I think it should be min instead of max?

 max_ancestors_count: cmp::min(DEFAULT_MAX_ANCESTORS_COUNT, max_ancestors_count), 

Maybe we should only set the max_ancestors_count to DEFAULT_MAX_ANCESTORS_COUNT when the user doesn't specify it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

no, it's max.
I think this commit is not complete, since we change from 25 to 125, we'd better also change the value in ckb.toml?
07d4db9

@zhangsoledad

Merged via the queue into nervosnetwork:develop with commit ecda90b Jan 25, 2024
40 checks passed
@gpBlockchain
Copy link
Collaborator

LGMT

@doitian doitian mentioned this pull request Jan 29, 2024
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.

5 participants