-
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
Remove some settings from policy contract #2300
Conversation
A step back to Neo 2 IMO. I'd rather have protocol configuration file contain the bare minimum to successfully operate on the network/process chain (like magic and seed nodes list) and everything else should be discoverable from on-chain data. Consider updating these values, going through chain is like sending one transaction and everything works, but changing configuration files requires synchronization between CN maintainers and restarts. |
These settings are more about consensus. And the consensus is moved to plugin. So we should remove these settings from core. |
I think that any consensus need these kind of limits, so it's good to have this configuration shared and stored in the chain |
But who can modify these settings? The committee? I don't think so. Maybe the core developers should be responsible for modifying them. |
Committee runs the network, so committee sets the setting. In a transparent and traceable way. |
The code is good for me. These parameters are mainly protocol security parameters, which can not be determined by committee. |
Go? |
Testing. Please wait. |
How the core developers will ensure that all the nodes will have the same policiy file? maybe we should add this configuration inside the blockchain and allow only core developers to change it |
I think it is impossible. |
With hardcoded url and oracle we can update a json in |
I don't think a decentralized blockchain should rely on a centralized website. |
It will be the same with the config file. |
It won't. With config file you can "choose" to update or not. |
But you can't set arbitrary values there, the network won't function properly if there is any disagreement between CNs wrt this values. |
@@ -287,8 +287,6 @@ public virtual VerifyResult VerifyStateDependent(DataCache snapshot, Transaction | |||
foreach (UInt160 hash in hashes) | |||
if (NativeContract.Policy.IsBlocked(snapshot, hash)) | |||
return VerifyResult.PolicyFail; | |||
if (NativeContract.Policy.GetMaxBlockSystemFee(snapshot) < SystemFee) |
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.
If this check is removed, how to stop such transactions from getting into Mempool?
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 should treat service, storage and CPU fees differently, otherwise the restrictions on fees are meaningless. This can be done later.
It seems there is a problem here, when CN all update their protocol settings to set a smaller MaxTransactionsPerBlock, and before the change, there is already a bigger MaxTransactionsPerBlock number of TX persisted in the previous blocks. then the CN failed to start. scenario: public void Deserialize(BinaryReader reader)
{
Header = reader.ReadSerializable<Header>();
Transactions = reader.ReadSerializableArray<Transaction>((int)ProtocolSettings.Default.MaxTransactionsPerBlock);
if (Transactions.Distinct().Count() != Transactions.Length)
throw new FormatException();
if (MerkleTree.ComputeRoot(Transactions.Select(p => p.Hash).ToArray()) != Header.MerkleRoot) |
This field cannot be set smaller. |
Go? |
I am good. Except a little concern that there is a possibility to set the max transaction smaller than the previous configuration |
This is impossible. Because it is hard-coded, and we will only make it larger. |
@@ -368,8 +367,7 @@ internal void UpdatePoolForBlockPersisted(Block block, DataCache snapshot) | |||
if (block.Index > 0 && _system.HeaderCache.Count > 0) | |||
return; | |||
|
|||
uint _maxTxPerBlock = NativeContract.Policy.GetMaxTransactionsPerBlock(snapshot); | |||
ReverifyTransactions(_sortedTransactions, _unverifiedSortedTransactions, (int)_maxTxPerBlock, MaxMillisecondsToReverifyTx, snapshot); | |||
ReverifyTransactions(_sortedTransactions, _unverifiedSortedTransactions, (int)ProtocolSettings.Default.MaxTransactionsPerBlock, MaxMillisecondsToReverifyTx, snapshot); |
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.
Should we eliminate the use of ProtocolSettings.Default
here?
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.
It should be fixed by #2337
* Sync neo-project/neo#2300 * Update nuget
* neo-project/neo#2295 * neo-project/neo#2290 * neo-project/neo#2292 * neo-project/neo#2296 * neo-project/neo#2301 * neo-project/neo#2298 * neo-project/neo#2312 * neo-project/neo#2300 * neo-project/neo#2333 * neo-project/neo#2337 * neo-project/neo#2331 * neo-project/neo#2332 * neo-project/neo#2343 * neo-project/neo#2339 * neo-project/neo#2350 * neo-project/neo#2351 * neo-project/neo#2353 * neo-project/neo#2356 * neo-project/neo#2375 * neo-project/neo#2377 * neo-project/neo#2379 * https://github.com/neo-project/neo/pull/2392/files * neo-project/neo#2400 * audit updates * refactor and bump VM requirement
No description provided.