-
Notifications
You must be signed in to change notification settings - Fork 236
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
zhangsoledad
merged 2 commits into
nervosnetwork:develop
from
chenyukang:yukang-fix-celldep-limit
Jan 25, 2024
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
use crate::component::links::{Relation, TxLinks, TxLinksMap}; | ||
use ckb_types::packed::ProposalShortId; | ||
use ckb_types::prelude::Entity; | ||
use std::collections::HashSet; | ||
|
||
#[test] | ||
fn test_link_map() { | ||
let mut map = TxLinksMap::default(); | ||
let id1 = ProposalShortId::from_slice(&[1; 10]).unwrap(); | ||
let id2 = ProposalShortId::from_slice(&[2; 10]).unwrap(); | ||
let id3 = ProposalShortId::from_slice(&[3; 10]).unwrap(); | ||
let id4 = ProposalShortId::from_slice(&[4; 10]).unwrap(); | ||
|
||
map.add_link(id1.clone(), TxLinks::default()); | ||
map.add_link(id2.clone(), TxLinks::default()); | ||
map.add_link(id3.clone(), TxLinks::default()); | ||
map.add_link(id4.clone(), TxLinks::default()); | ||
|
||
map.add_parent(&id1, id2.clone()); | ||
let expect: HashSet<ProposalShortId> = vec![id2.clone()].into_iter().collect(); | ||
assert_eq!(map.get_parents(&id1).unwrap(), &expect); | ||
|
||
map.add_direct_parent(&id1, id2.clone()); | ||
map.add_direct_parent(&id2, id3.clone()); | ||
map.add_direct_parent(&id3, id4.clone()); | ||
let direct_parents = map.calc_relation_ids([id1.clone()].into(), Relation::DirectParents); | ||
assert_eq!(direct_parents.len(), 4); | ||
|
||
map.remove(&id3); | ||
let direct_parents = map.calc_relation_ids([id1.clone()].into(), Relation::DirectParents); | ||
assert_eq!(direct_parents.len(), 2); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
mod chunk; | ||
mod entry; | ||
mod links; | ||
mod orphan; | ||
mod pending; | ||
mod proposed; | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
But I found:
https://github.com/nervosnetwork/ckb/blob/4851b307b018b6bc86d2f79632223c97364f53c6/resource/ckb.toml#L140-L139
the
max_ancestors_count
in default config is 25, butDEFAULT_MAX_ANCESTORS_COUNT
is 125.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.
I think we can change the parameter in
ckb.toml
to 125 later.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.
I think it's a comment error, we should change the default const value to 25 also.
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.
Should we change
const DEFAULT_MAX_ANCESTORS_COUNT: usize
to 25 too?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.
it should be 125?
ckb/util/app-config/src/legacy/tx_pool.rs
Line 123 in b8ccf92
25 is originally referred from bitcoin, we use 125.
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.
I think it should be
min
instead ofmax
?Maybe we should only set the
max_ancestors_count
toDEFAULT_MAX_ANCESTORS_COUNT
when the user doesn't specify it?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.
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