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

Policy inputs checks #1938

Merged
merged 10 commits into from
Sep 19, 2020
Merged

Policy inputs checks #1938

merged 10 commits into from
Sep 19, 2020

Conversation

shargon
Copy link
Member

@shargon shargon commented Sep 16, 2020

Close #1937

@erikzhang
Copy link
Member

UT failed.

Co-authored-by: Erik Zhang <erik@neo.org>
erikzhang
erikzhang previously approved these changes Sep 17, 2020
@roman-khimov
Copy link
Contributor

Looks good, but how about 128K limit for Block.MaxTransactionsPerBlock?

@shargon
Copy link
Member Author

shargon commented Sep 18, 2020

Looks good, but how about 128K limit for Block.MaxTransactionsPerBlock?

I think that this need more tests, it can be related with the time per block reduction issue. #375 @roman-khimov could you create a different issue for this?

@shargon
Copy link
Member Author

shargon commented Sep 18, 2020

UT Fixed

@roman-khimov
Copy link
Contributor

I can, but to me it doesn't seem to be related to #375, it's just a matter of size match between PayloadMaxSize and MaxTransactionsPerBlock. With current MaxTransactionsPerBlock one block can't use all of PayloadMaxSize capacity irrespective of MillisecondsPerBlock.

@shargon
Copy link
Member Author

shargon commented Sep 18, 2020

For me it's related because both pretend to increase TPS changing the tx per block or the seconds per block, but it's more or less the same. Maybe I am wrong

@roman-khimov
Copy link
Contributor

both pretend to increase TPS

I don't. I'm specifically not mentioning TPS here, it's just a matter of match between different components of the system. There is a P2P payload limit, there has to be some, the maximum possible block size should probably match it and the maximum possible block size should be practically reachable with MaxTransactionsPerBlock, that's it.

it's more or less the same

And #375 is more about latency to me. Of course, there is a natural MemoryPoolMaxTransactions/MillisecondsPerBlock ratio, but for mainnet/testnet this ratio doesn't seem to be a problem to me from the TPS perspective.

@shargon
Copy link
Member Author

shargon commented Sep 18, 2020

What do you think @erikzhang ?

public const int MaxContentsPerBlock = 134_000; // (PayloadMaxSize=0x02000000)/(AverageTxSize=250)

Or maybe we can remove this variable and compute it according to PayloadMaxSize

@erikzhang
Copy link
Member

PayloadMaxSize is not for blocks only.

@erikzhang
Copy link
Member

And I want to limit the average block size to 256KB.

@shargon shargon merged commit 81ebb7d into neo-project:master Sep 19, 2020
@shargon shargon deleted the ensure-policy-limit branch September 19, 2020 07:23
ShawnYun pushed a commit to ShawnYun/neo that referenced this pull request Jan 8, 2021
* Policy contract's SetMaxTransactionsPerBlock() doesn't check for Block.MaxTransactionsPerBlock

* add more

* Clean change

* Fix ut

* throw exceptions

* ArgumentOutOfRangeException

* Update src/neo/SmartContract/Native/PolicyContract.cs

Co-authored-by: Erik Zhang <erik@neo.org>

* Fix UT

* Update NativeContractExtensions.cs

Co-authored-by: erikzhang <erik@neo.org>
cloud8little pushed a commit to cloud8little/neo that referenced this pull request Jan 24, 2021
* Policy contract's SetMaxTransactionsPerBlock() doesn't check for Block.MaxTransactionsPerBlock

* add more

* Clean change

* Fix ut

* throw exceptions

* ArgumentOutOfRangeException

* Update src/neo/SmartContract/Native/PolicyContract.cs

Co-authored-by: Erik Zhang <erik@neo.org>

* Fix UT

* Update NativeContractExtensions.cs

Co-authored-by: erikzhang <erik@neo.org>
ixje added a commit to CityOfZion/neo-mamba that referenced this pull request Feb 2, 2021
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.

Policy contract's SetMaxTransactionsPerBlock() doesn't check for Block.MaxTransactionsPerBlock
3 participants