-
Notifications
You must be signed in to change notification settings - Fork 655
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(resharding): storage costs (#12661)
Fixing old storage costs inaccuracy, which caused a failure during some forknet experiment https://near.zulipchat.com/#narrow/channel/407288-core.2Fresharding/topic/forknet/near/489699725 The fix is one-liner, `charge_gas_for_trie_node_access: false,`. Originally it wasn't the case because we had a protocol upgrade from trie to flat storage read costs, so we needed to compute costs differently. But since flat storage costs were enabled, and we started to use only the flat storage read costs. Moreover, later it became controlled by runtime `Parameter::FlatStorageReads`, but the original condition stayed. And now, when we do flat storage resharding, flat storage indeed doesn't exist for a while, which triggered trie costs for some blocks during resharding again. However, on chunk validation, costs were correct, so chain couldn't validate any chunks since resharding start. I test this by calling a contract which reads a key and then writes key-value pair back. For the old code, key read charges more cost than it should, which causes InvalidOutcomesProof error. --------- Co-authored-by: wacban <[email protected]>
- Loading branch information
1 parent
1704c55
commit 9d535a8
Showing
7 changed files
with
138 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters