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

feat: cherry-pick pbss patch commits from eth repo in v1.13.2 #1916

Merged
merged 10 commits into from
Oct 16, 2023

Conversation

@joeylichang joeylichang force-pushed the pbss_cherry_pick branch 3 times, most recently from 3fea197 to 68722d0 Compare October 11, 2023 16:32
@joeylichang joeylichang changed the title feat: cherry-pick pbss patch commits from eth repo before v1.13.2 feat: cherry-pick pbss patch commits from eth repo in v1.13.2 Oct 12, 2023
@joeylichang joeylichang force-pushed the pbss_cherry_pick branch 2 times, most recently from 2d446ba to 7d9234c Compare October 12, 2023 18:57
@buddh0
Copy link
Collaborator

buddh0 commented Oct 13, 2023

TestStateChanges can be recovered now,
and recover lint for statedb_fuzz_test.go

@joeylichang joeylichang force-pushed the pbss_cherry_pick branch 2 times, most recently from 6378137 to 674528c Compare October 13, 2023 04:32
fynnss
fynnss previously approved these changes Oct 13, 2023
Copy link
Contributor

@fynnss fynnss left a comment

Choose a reason for hiding this comment

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

LGTM

@buddh0
Copy link
Collaborator

buddh0 commented Oct 13, 2023

TestStateChanges can be recovered now, and recover lint for statedb_fuzz_test.go

image

recovering lint for statedb_fuzz_test.go is ok now , so we can remove lines in green background

RenRick
RenRick previously approved these changes Oct 13, 2023
Copy link

@RenRick RenRick left a comment

Choose a reason for hiding this comment

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

LGTM

return err
}

if localHeight >= remoteHeight {
Copy link
Collaborator

@buddh0 buddh0 Oct 13, 2023

Choose a reason for hiding this comment

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

delete this is ok? I remember it's used to fix lagging nodes issue
https://github.com/bnb-chain/bsc/pull/1301/files

// If a part of blockchain data has already been written into active store,
// disable the ancient style insertion explicitly.
if origin >= frozen && itemAmountInAncient != 0 {
Copy link
Collaborator

Choose a reason for hiding this comment

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

even frozen!=0
item amount in ancient may be zero
so keep use itemAmountInAncient?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

revert, eth/downloader change will be solved in next PR.

@@ -936,10 +994,6 @@ func (d *Downloader) findAncestorBinarySearch(p *peerConnection, mode SyncMode,
continue
}
header := d.lightchain.GetHeaderByHash(h) // Independent of sync mode, header surely exists
if header == nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

why remove this?

Copy link
Contributor Author

@joeylichang joeylichang Oct 16, 2023

Choose a reason for hiding this comment

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

ditto

rejected []*types.Header
td *big.Int
)
if !beaconMode && ttd != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

for bsc, ttd is nil forever
so these codes are useless, but keep them is ok, making code align with go-ethereum

@@ -1712,8 +1829,17 @@ func (d *Downloader) reportSnapSyncProgress(force bool) {
return
}
// Retrieve the current chain head and calculate the ETA
// We're going to cheat for non-merged networks, but that's fine
latest := d.pivotHeader
latest, _, _, err := d.skeleton.Bounds()
Copy link
Collaborator

Choose a reason for hiding this comment

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

skeleton sync is useless for bsc
that‘s why I remove them when big merge
bringing them in is ok, so we can pay lower effort when next pick ups

karalabe and others added 9 commits October 16, 2023 09:55
This changes implements faster post-selfdestruct iteration of storage slots for deletion, by using snapshot-storage+stacktrie to recover the trienodes to be deleted. This mechanism is only implemented for path-based schema.

For hash-based schema, the entire post-selfdestruct storage iteration is skipped, with this change, since hash-based does not actually perform deletion anyway.

---------

Co-authored-by: Martin Holst Swende <martin@swende.se>
Avoid truncating files, if ancients are opened in readonly mode. With this change, we return error instead of trying (and failing)  to repair
…(#28163)

* trie: remove internal nodes between shortNode and child in path mode

* trie: address comments

* core/rawdb, trie: address comments

* core/rawdb: delete unused func

* trie: change comments

* trie: add missing tests

* trie: fix lint
@joeylichang joeylichang merged commit 9f5842e into develop Oct 16, 2023
4 of 5 checks passed
@joeylichang joeylichang deleted the pbss_cherry_pick branch November 7, 2023 03:35
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.

10 participants