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

Remove the case of GetData in ProtocolHandlerMailbox#ShallDrop in 2.x #1206

Closed
wants to merge 11 commits into from
Closed

Remove the case of GetData in ProtocolHandlerMailbox#ShallDrop in 2.x #1206

wants to merge 11 commits into from

Conversation

doubiliu
Copy link
Contributor

@doubiliu doubiliu commented Nov 7, 2019

port to 2.x
Remove the case of GetData in ProtocolHandlerMailbox#ShallDrop has merged in 3.0

shargon
shargon previously approved these changes Nov 7, 2019
Copy link
Member

@vncoelho vncoelho left a comment

Choose a reason for hiding this comment

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

I am not 100% confident of merging this PR to master2x.

Check my comment: #1201 (comment)

I would be more certain if the ShalDrop was just for the ConsensusGetData type and not all GetData. That just would require was to create this new command.

@Tommo-L
Copy link
Contributor

Tommo-L commented Nov 11, 2019

I would be more certain if the ShallDrop was just for the ConsensusGetData type and not all GetData.

It's true, but RestartTasks appears less frequently under normal circumstances.

@shargon
Copy link
Member

shargon commented Nov 11, 2019

I am not 100% confident of merging this PR to master2x.

What is the difference with neo3?

Copy link
Contributor

@lock9 lock9 left a comment

Choose a reason for hiding this comment

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

These are the same changes applied on #1201.
@belane Do we need to test this again for neo 2? By reading @vncoelho comments, it seems that this change can be exploited by a malicious user.

@vncoelho
Copy link
Member

What is the difference with neo3?

Neo3 is under development, @shargon, we can still have time to test it more.
I believe we need this only for consensus GetData and not all GetData.
Do you agree, @Tommo-L? If not, let me know and I can think more about it.

@Tommo-L
Copy link
Contributor

Tommo-L commented Nov 26, 2019

I believe we need this only for consensus GetData and not all GetData.

I agree.
It's ok for me to create a GetConsensusData type.

@vncoelho
Copy link
Member

vncoelho commented Dec 9, 2019

Hi @Tommo-L, how is it going? Should we create this type and merge this? Or better to wait for a stable NEO3-preview for testing it there?

@Tommo-L
Copy link
Contributor

Tommo-L commented Dec 10, 2019

😂 We haven't added this type, we hope that Neo2.x remains as functionally unchanged as possible. The introduction of new types will affect consensus modules.

@vncoelho
Copy link
Member

AHueahuea, then we need to decide if we merge this, wait for NEO3x preview to see results or close...

@Tommo-L
Copy link
Contributor

Tommo-L commented Dec 10, 2019

We can wait for the result of Neo3 preview, considering that the next stable version of 2.x will take some days

@cloud8little
Copy link
Contributor

cloud8little commented Dec 18, 2019

Test result of this PR: Fail
Scenario One: Passed
send 48225 valid request, include fee added, and free nep5 transaction in 50 minutes. when transactions are all processed via consensus node, checked all txs are on-chain.
4821576636977_ pic_hd

Scenario Two: Failed
Network Topology
4931576813505_ pic
It found that not all transactions are on-chain when pool is 0 in the end. the loss tx rate is about 10%.
It needs further investigation.
nep5contract.zip

@doubiliu doubiliu closed this Dec 24, 2019
@doubiliu doubiliu reopened this Dec 24, 2019
@doubiliu
Copy link
Contributor Author

@cloud8little
As we discussed, in the default configuration, the upper limit of the memory pool is 50,000 transactions, so if the test pressure is greater than the upper limit, it is normal to lose transactions.In addition, another cause of transaction loss is that the 2.0 version is UTXO model, and paid transactions will be limited.Therefore, the ideal test method is to test only free transactions. If the transactions are not lost in a large amount below the upper limit of the memory pool, it is feasible.

@cloud8little
Copy link
Contributor

cloud8little commented Dec 30, 2019

@doubiliu thanks very much for the detailed explanations. Here are the test result.
Network topology is the same as above. while the total number of transactions is different.

  1. free fee + pay fee transaction; number of transactions > 50000; tx loss, all loss txs are pay fee transaction.
  2. All free fee transaction; number of transactions = 47000+ < 50000; no tx loss.
  3. 2/3 free fee + 1/3 pay fee transaction; number of transactions = 18000 in 10minutes < 50000; about 5% tx loss.
    So I thought this PR aims to improve the TPS, instead of solving tx loss problem.

@vncoelho
Copy link
Member

vncoelho commented Jan 6, 2020

Nice discussions.

@cloud8little, where there gains in performance?

@doubiliu, can you check this comment again, please? #1201 (comment)

I am still not sure because this could be a path to attacks.
What do you think, @shargon? Not too much real risks? I saw that you already approved.

@shargon
Copy link
Member

shargon commented Jan 6, 2020

If it's an non required optimization, and it could produce some errors, I prefer to not merge this.

@shargon shargon self-requested a review January 6, 2020 16:54
@Tommo-L
Copy link
Contributor

Tommo-L commented Mar 13, 2020

We'll close this PR, as we don't want to add non-repair features to 2.x.

@doubiliu doubiliu closed this Mar 13, 2020
@shargon shargon deleted the removeGetData-2.x branch March 13, 2020 08:31
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.

6 participants