Remove MillisecondsPerBlock, MaxValidUntilBlockIncrement, MaxTraceableBlocks from PolicyContract#4337
Conversation
…eBlocks from PolicyContract
vncoelho left a comment
There was a problem hiding this comment.
I understand the change and looks fine for its purpose.
The reasoning here is probably to avoid unnecessary state changes on a SC and the parameter become a stateless decision agreed by CN's.
On the hand other, one may need to monitor P2P to understand network heartbeat, right?
# Conflicts: # src/Neo/SmartContract/Native/PolicyContract.cs
But this must be configured by the policy, isn't it? so instead of remove we should move this config to each level |
I hope this parameter will be adaptive in the future, requiring no adjustment. For now, we can treat it as a configuration item for the consensus plugin. |
| As I asked above, what is the main reason behind this? To avoid state changes on the blockchain, right? |
| { | ||
| var mtb = Policy.GetMaxTraceableBlocks(engine.SnapshotCache); | ||
| return IsTraceableBlock(engine.SnapshotCache, index, mtb); | ||
| return IsTraceableBlock(engine.SnapshotCache, index, engine.ProtocolSettings.MaxTraceableBlocks); |
There was a problem hiding this comment.
How can we ensure the deterministic behavior between nodes if any node can have a different configuration? We can use a hash of the config for Blockchain id, but seems easier in policy
There was a problem hiding this comment.
In terms of behavior, as it will be we will only measure due to performance.
Maybe with something like neo-project/proposals#211 (comment)
On the other hand, I am trying to understand the real motivation behind this. If this is to avoid state changes.
In particular, I believe that for such things we should implement a temporary state, such as Blobs.
There was a problem hiding this comment.
So, instead of writing on a Native Contract we publish that states with Blobs that will become unavailable in the future.
That is what ETH did for making Layer 2 cheaper.
There was a problem hiding this comment.
How can we ensure the deterministic behavior between nodes if any node can have a different configuration? We can use a hash of the config for Blockchain id, but seems easier in policy
There's no difference between putting parameters in a configuration file and hard-coding them in the code. The purpose of a configuration file is to provide different parameters for different networks, not to allow different nodes to modify them arbitrarily.
| Remove |
In fact, another important reason for removing |
shargon left a comment
There was a problem hiding this comment.
Let's check the expected behavior when finish the dynamic block interval
…eBlocks from PolicyContract
Remove
MillisecondsPerBlock,MaxValidUntilBlockIncrement,MaxTraceableBlocksfromPolicyContract.MaxValidUntilBlockIncrementandMaxTraceableBlocksshould be exposed as immutable values.Type of change
How Has This Been Tested?
Checklist: