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

doc: improve documentation for trie crate #5872

Merged
merged 9 commits into from
Dec 29, 2023
Merged

Conversation

tcoratger
Copy link
Contributor

@tcoratger tcoratger commented Dec 27, 2023

This PR introduces enhanced documentation in the trie crate.

crates/trie/src/node_iter.rs Outdated Show resolved Hide resolved
crates/trie/src/node_iter.rs Outdated Show resolved Hide resolved
@rkrasiuk
Copy link
Member

i am in favor of accepting additional docs, but against the refactor. the readability is arguably improved and it might introduce unexpected behavioral changes not caught in the review

@tcoratger
Copy link
Contributor Author

i am in favor of accepting additional docs, but against the refactor. the readability is arguably improved and it might introduce unexpected behavioral changes not caught in the review

@rkrasiuk I just found the bug that caused the CI to fail, I fixed it. No worries, I completely understand your point about refactoring, it generates additional review time for your team and you can consider it not useful sometimes as long as the functions are readable and work.

I'm taking advantage of a few hours of free time to read the code and try to figure it out in its entirety. I add documentation where I see that it is missing and I try to improve certain small functions when I see that it is possible to make them a little more readable or more Rust idiomatic to maintain a perfect codebase.

However if you don't want code changes like that I completely understand and I can revert all the modified functions, there is no problem :) Just tell me

(I'm also trying to compare with Geth to see where reth is behind)

@rkrasiuk
Copy link
Member

@tcoratger really appreciate you spending your free time around the codebase! i don't mind refactors and spending additional time reviewing them if they bring meaningful improvements to the readability of the code. my perceived defensiveness is caused by the sensitivity of this code and it being in the critical path of the stability of the node. hope you understand :)

@tcoratger tcoratger changed the title refactor: small refactoring for trie crate and documentation doc: improve documentation for trie crate Dec 28, 2023
@tcoratger
Copy link
Contributor Author

@rkrasiuk Of course I understand, no problem at all. Just pushed a commit where I reverted all function refactoring :)

@rkrasiuk
Copy link
Member

@tcoratger thanks! i don't mind having the refactor in a separate PR. i'll just have to run additional non-automated tests to confirm everything works as expected

crates/trie/src/node_iter.rs Outdated Show resolved Hide resolved
crates/trie/src/node_iter.rs Outdated Show resolved Hide resolved
crates/trie/src/trie_cursor/noop.rs Outdated Show resolved Hide resolved
crates/trie/src/trie_cursor/noop.rs Outdated Show resolved Hide resolved
crates/trie/src/trie_cursor/noop.rs Outdated Show resolved Hide resolved
Copy link
Member

@rkrasiuk rkrasiuk left a comment

Choose a reason for hiding this comment

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

lgtm, thanks!

@rkrasiuk rkrasiuk added C-docs An addition or correction to our documentation A-trie Related to Merkle Patricia Trie implementation labels Dec 29, 2023
@rkrasiuk rkrasiuk added this pull request to the merge queue Dec 29, 2023
@tcoratger
Copy link
Contributor Author

@tcoratger thanks! i don't mind having the refactor in a separate PR. i'll just have to run additional non-automated tests to confirm everything works as expected

@rkrasiuk Of course, will open another PR in a bit with the refactor so that you can have a deep look if you are interested :)

Merged via the queue into paradigmxyz:main with commit f2bac81 Dec 29, 2023
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-trie Related to Merkle Patricia Trie implementation C-docs An addition or correction to our documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants