-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Decrease block time to 3s #3612
base: master
Are you sure you want to change the base?
Changes from all commits
b5fd4ec
91c4bd2
9ba85d8
a095496
3329c54
774471a
739beaf
af42801
9d677c5
cd91440
26b1e58
3b52a3c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,8 +30,8 @@ | |
"ProtocolConfiguration": { | ||
"Network": 894710606, | ||
"AddressVersion": 53, | ||
"MillisecondsPerBlock": 15000, | ||
"MaxTransactionsPerBlock": 5000, | ||
"MillisecondsPerBlock": 3000, | ||
"MaxTransactionsPerBlock": 256, | ||
"MemoryPoolMaxTransactions": 50000, | ||
"MaxTraceableBlocks": 2102400, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Notice that it'd be ~73 days instead of current year. But I'd rather cut it down even more aggressively (see FS network settings). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree, let's say 64 or 128? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Opinions are welcome, your values remind me of E-letter chain. Nothing bad about that, but historic data (#2026) suggests our contracts are more used to somewhat longer history available. NeoFS networks use 17280 (3 days of 15s blocks). |
||
"Hardforks": { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,7 +69,7 @@ public record ProtocolSettings | |
/// <summary> | ||
/// The maximum increment of the <see cref="Transaction.ValidUntilBlock"/> field. | ||
/// </summary> | ||
public uint MaxValidUntilBlockIncrement => 86400000 / MillisecondsPerBlock; | ||
public uint MaxValidUntilBlockIncrement => 86400000 / MillisecondsPerBlock; //TODO keep the same?? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one is configurable per-network, so I'd rather leave the default as is and configure particular networks. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok |
||
|
||
/// <summary> | ||
/// Indicates the maximum number of transactions that can be contained in a block. | ||
|
@@ -113,8 +113,8 @@ public record ProtocolSettings | |
StandbyCommittee = Array.Empty<ECPoint>(), | ||
ValidatorsCount = 0, | ||
SeedList = Array.Empty<string>(), | ||
MillisecondsPerBlock = 15000, | ||
MaxTransactionsPerBlock = 512, | ||
MillisecondsPerBlock = 3000, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure we need to change defaults. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it is better, @roman-khimov , because it may, in the future, reflect in some of our tests that use default. Better to keep consistent. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because we will change testnet only before, it's better to avoid default changes |
||
MaxTransactionsPerBlock = 256, | ||
MemoryPoolMaxTransactions = 50_000, | ||
MaxTraceableBlocks = 2_102_400, | ||
InitialGasDistribution = 52_000_000_00000000, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -193,7 +193,10 @@ internal override ContractTask InitializeAsync(ApplicationEngine engine, Hardfor | |
engine.SnapshotCache.Add(CreateStorageKey(Prefix_Committee), new StorageItem(cachedCommittee)); | ||
engine.SnapshotCache.Add(_votersCount, new StorageItem(System.Array.Empty<byte>())); | ||
engine.SnapshotCache.Add(CreateStorageKey(Prefix_GasPerBlock).AddBigEndian(0u), new StorageItem(5 * GAS.Factor)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ping @shargon There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that maybe it should be enabled with 1 instead of 5 after certain height. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be moved to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can't change it without affecting post-genesis state. And I see zero reason to do this, mainnet/testnet don't care, this will be adjusted by the committee, private networks are fine with whatever default and they can also adjust it if needed. |
||
// TODO - Add hardfork otherwise storage will be different | ||
// After HARD FORK | ||
engine.SnapshotCache.Add(_registerPrice, new StorageItem(1000 * GAS.Factor)); | ||
|
||
return Mint(engine, Contract.GetBFTAddress(engine.ProtocolSettings.StandbyValidators), TotalAmount, false); | ||
} | ||
return ContractTask.CompletedTask; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,8 +95,8 @@ private void OnPrepareRequestReceived(ExtensiblePayload payload, PrepareRequest | |
} | ||
|
||
// Timeout extension: prepare request has been received with success | ||
// around 2*15/M=30.0/5 ~ 40% block time (for M=5) | ||
ExtendTimerByFactor(2); | ||
// around 4*3/M=12.0/5 ~ 80% block time (for M=5) | ||
ExtendTimerByFactor(4); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be computed according the configured time per block |
||
|
||
context.Block.Header.Timestamp = message.Timestamp; | ||
context.Block.Header.Nonce = message.Nonce; | ||
|
@@ -171,8 +171,8 @@ private void OnPrepareResponseReceived(ExtensiblePayload payload, PrepareRespons | |
return; | ||
|
||
// Timeout extension: prepare response has been received with success | ||
// around 2*15/M=30.0/5 ~ 40% block time (for M=5) | ||
ExtendTimerByFactor(2); | ||
// around 4*3/M=12.0/5 ~ 80% block time (for M=5) | ||
ExtendTimerByFactor(4); | ||
|
||
Log($"{nameof(OnPrepareResponseReceived)}: height={message.BlockIndex} view={message.ViewNumber} index={message.ValidatorIndex}"); | ||
context.PreparationPayloads[message.ValidatorIndex] = payload; | ||
|
@@ -210,8 +210,8 @@ private void OnCommitReceived(ExtensiblePayload payload, Commit commit) | |
if (commit.ViewNumber == context.ViewNumber) | ||
{ | ||
// Timeout extension: commit has been received with success | ||
// around 4*15s/M=60.0s/5=12.0s ~ 80% block time (for M=5) | ||
ExtendTimerByFactor(4); | ||
// around 6*3s/M=18.0s/5=12.0s ~ 120% block time (for M=5) | ||
ExtendTimerByFactor(6); | ||
|
||
Log($"{nameof(OnCommitReceived)}: height={commit.BlockIndex} view={commit.ViewNumber} index={commit.ValidatorIndex} nc={context.CountCommitted} nf={context.CountFailed}"); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ namespace Neo.Plugins.StateService.Verification | |
{ | ||
class VerificationContext | ||
{ | ||
private const uint MaxValidUntilBlockIncrement = 100; | ||
private const uint MaxValidUntilBlockIncrement = 100; // Change to 500!?? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Whoa. Unexpected one. It's totally different from the "regular" MVUBI, but 500 here would let more ExtensiblePayloads with signatures float around the network, I doubt the intention here was to have it related to time. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should related it with the timeblock There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you guys should decide, that is why I left as comment. |
||
private StateRoot root; | ||
private ExtensiblePayload rootPayload; | ||
private ExtensiblePayload votePayload; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MaxTransactionsPerBlock can be kept as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it need to be changed, I think that this comment here contradicts your comment below. I did not understand. You said to cut even more aggressively.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to reduce
MaxTraceableBlocks
, notMaxTransactionsPerBlock
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all can be reduced, each block wont be able to process that amount of transactions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C# node can handle several thousands of simple NEP-17 transfers per second. It's all about
MaxBlockSystemFee
(#3552), notMaxTransactionsPerBlock
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that for a first release these proposed values are good.
They can be increased easily, the opposite is more complicated in my opnion.
So, I think we should just move forward.