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

refactor(trie): change isCheckpoint getter to hasCheckpoints checker #2218

Merged
merged 34 commits into from
Aug 24, 2022

Conversation

faustbrian
Copy link
Contributor

@faustbrian faustbrian commented Aug 24, 2022

Leaving as draft until #2215 is merged

get/set functions are generally considered black magic in terms of DX because it gives the illusion that you're working with a property and developers might try to set the property too even though only a getter is available. Now you could argue that an IDE can catch this but you shouldn't build your projects around that the assumption that everyone runs an IDE with all kinds of features and plugins. All that can be prevented by simply using functions that make it clear that you're not working with a property.

Besides that the name wasn't very descriptive because the function body reads as database has more than 0 checkpoints.

holgerd77 and others added 30 commits August 23, 2022 12:32
Signed-off-by: Brian Faust <hello@basecode.sh>
Signed-off-by: Brian Faust <hello@basecode.sh>
Signed-off-by: Brian Faust <hello@basecode.sh>
Signed-off-by: Brian Faust <hello@basecode.sh>
Signed-off-by: Brian Faust <hello@basecode.sh>
Signed-off-by: Brian Faust <hello@basecode.sh>
Signed-off-by: Brian Faust <hello@basecode.sh>
Signed-off-by: Brian Faust <hello@basecode.sh>
Signed-off-by: Brian Faust <hello@basecode.sh>
Signed-off-by: Brian Faust <hello@basecode.sh>
Signed-off-by: Brian Faust <hello@basecode.sh>
@codecov
Copy link

codecov bot commented Aug 24, 2022

Codecov Report

Merging #2218 (4629636) into master (fffe4ab) will increase coverage by 1.94%.
The diff coverage is 81.81%.

Impacted file tree graph

Flag Coverage Δ
block 92.98% <ø> (ø)
blockchain 88.88% <ø> (?)
client 86.99% <ø> (-0.02%) ⬇️
common 59.55% <ø> (ø)
devp2p 92.30% <ø> (-0.03%) ⬇️
ethash ?
evm ?
rlp ∅ <ø> (∅)
statemanager 88.15% <ø> (ø)
trie 90.26% <81.81%> (+0.31%) ⬆️
tx 97.98% <ø> (ø)
util 92.33% <ø> (ø)
vm 85.24% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@faustbrian faustbrian changed the base branch from master to trie-checkpoint-option August 24, 2022 02:15
@faustbrian faustbrian changed the title hasCheckpoints refactor(trie): replace isCheckpoint getter with hasCheckpoints checker Aug 24, 2022
@faustbrian faustbrian changed the title refactor(trie): replace isCheckpoint getter with hasCheckpoints checker refactor(trie): change isCheckpoint getter to hasCheckpoints checker Aug 24, 2022
@faustbrian faustbrian marked this pull request as ready for review August 24, 2022 02:19
@faustbrian faustbrian marked this pull request as draft August 24, 2022 02:20
Base automatically changed from trie-checkpoint-option to master August 24, 2022 09:46
@faustbrian
Copy link
Contributor Author

@holgerd77 conflicts resolves

@faustbrian faustbrian marked this pull request as ready for review August 24, 2022 10:05
@faustbrian
Copy link
Contributor Author

Just ran this against my app and its test suite and all good.

@faustbrian faustbrian requested review from holgerd77 and jochem-brouwer and removed request for holgerd77 August 24, 2022 10:27
Copy link
Member

@holgerd77 holgerd77 left a comment

Choose a reason for hiding this comment

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

This looks good, thanks! 🙂

This PR still has 34 commits, this is always a situation which always makes me nervous (might be unjustified, anyhow).

Also, you have now opened a lot of PRs, lol. 😋 While totally agree that - theoretically - it is really nice and the way "it should be" to have feature changes atomic in different PRs through our situation with the monorepo this unfortunately means a large waiting-cascade to go through one PR after the other, always with this 20-30 min CI wait time in between.

Can we therefore maybe settle to open up one new PR and I go through the PRs now one by one and review and then you cherry-pick the respective relevant 1-3 commits from the single PRs and push towards this one new PR? 🤔

That would help a lot to speed up the process, if we at the end only have to wait one time for CI. I would also say this is very much justifiable regarding the type of the changes.

@holgerd77
Copy link
Member

(also regarding our tight timing regarding the releases)

So, if you are ok with this, you could directly start with this PR and already pack #2226 on top (or other way around).

@faustbrian
Copy link
Contributor Author

Not sure I would go with the 1 PR because then it is a pain to revert things if the need arises 🤔

Copy link
Member

@holgerd77 holgerd77 left a comment

Choose a reason for hiding this comment

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

LGTM

@holgerd77 holgerd77 merged commit 7c0b0ad into master Aug 24, 2022
@holgerd77 holgerd77 deleted the hasCheckpoints branch August 24, 2022 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants