Conversation
|
A glance of this pr, no idea what its for. Would be great to have some comments in the code, and description in the pr. |
|
|
|
||
| uint index = engine.PersistingBlock.Index + 1; | ||
| StorageItem entry = engine.Snapshot.GetAndChange(CreateStorageKey(Prefix_GasPerBlock).AddBigEndian(index), () => new StorageItem(gasPerBlock)); | ||
| var gp = new GasPerBlock() { Gas = gasPerBlock, Index = engine.PersistingBlock.Index + 1 }; |
There was a problem hiding this comment.
one argument is missing here, no?
The correct constructor requires 3
There was a problem hiding this comment.
PreviousGas default value is 0
roman-khimov
left a comment
There was a problem hiding this comment.
- We need some number to proof this is worth doing at all.
- How often people request this via RPC?
| engine.Snapshot.Add(CreateStorageKey(Prefix_Committee), new StorageItem(cachedCommittee)); | ||
| engine.Snapshot.Add(CreateStorageKey(Prefix_VotersCount), new StorageItem(System.Array.Empty<byte>())); | ||
| engine.Snapshot.Add(CreateStorageKey(Prefix_GasPerBlock).AddBigEndian(0u), new StorageItem(5 * GAS.Factor)); | ||
| engine.Snapshot.Add(CreateStorageKey(Prefix_GasPerBlockCurrent), new StorageItem(new GasPerBlock() { Gas = 5 * GAS.Factor, PreviousGas = 5 * GAS.Factor, Index = 0 })); |
There was a problem hiding this comment.
Please, do not change the storage scheme, it's very easy to cache the value.
is not only requested by rpc, also is used on each block |
|
This returns us to #3145. It's very easy to cache for blocks (and not only for blocks). Storage scheme change that duplicates some already existing data should have more justification to me. |
|
@neo-project/core what about this pr? |
|
@shargon any plan on this pr? |
|
I will use a different approach |
Close #3145