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

Add block receive height limit #1870

Merged
merged 20 commits into from
Sep 6, 2020
Merged

Conversation

shargon
Copy link
Member

@shargon shargon commented Aug 24, 2020

Close #1859

@shargon shargon requested a review from erikzhang August 24, 2020 11:31
src/neo/Ledger/Blockchain.cs Outdated Show resolved Hide resolved
@erikzhang
Copy link
Member

Can't we just accept blocks lower than the current height + 500? It is impossible for us to request a block higher than the current height + 500.

@shargon
Copy link
Member Author

shargon commented Aug 25, 2020

Drop blocks higher than the current height + 500? It's ok for me, but also it will require to remove this blocks from known Hashes.

@erikzhang
Copy link
Member

  1. Drop blocks higher than the current height + 500.
  2. Block nodes that send blocks with different hashes at the same height.

@shargon
Copy link
Member Author

shargon commented Aug 26, 2020

Drop blocks higher than the current height + 500.

I will add this before append it to the knownHashes.

Block nodes that send blocks with different hashes at the same height.

We can do this in #1811 It could be done easy here

@shargon
Copy link
Member Author

shargon commented Aug 31, 2020

@erikzhang Ready to merge?

@shargon shargon changed the title Add block cache unverified limit Add block receive height limit Sep 1, 2020
@shargon shargon requested a review from erikzhang September 1, 2020 10:20
@shargon shargon merged commit 5bea103 into neo-project:master Sep 6, 2020
@shargon shargon deleted the block-cache-limit branch September 6, 2020 13:48
ShawnYun pushed a commit to ShawnYun/neo that referenced this pull request Jan 8, 2021
* Add block cache limit

* Remove known hashes

* Optimize

* Update Blockchain.cs

* Clean code

* Rename method

* Prevent process far blocks

* Block ACL

* Remove size control

neo-project#1870 (comment)

* Move knownHashes

* Remove no sender

* Rename

* Rename

* Update RemoteNode.ProtocolHandler.cs

Co-authored-by: erikzhang <[email protected]>
cloud8little pushed a commit to cloud8little/neo that referenced this pull request Jan 24, 2021
* Add block cache limit

* Remove known hashes

* Optimize

* Update Blockchain.cs

* Clean code

* Rename method

* Prevent process far blocks

* Block ACL

* Remove size control

neo-project#1870 (comment)

* Move knownHashes

* Remove no sender

* Rename

* Rename

* Update RemoteNode.ProtocolHandler.cs

Co-authored-by: erikzhang <[email protected]>
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.

Add a size limit to block_cache_unverified.
4 participants