nearcore icon indicating copy to clipboard operation
nearcore copied to clipboard

TrieCosts should be in a config

Open mikhailOK opened this issue 5 years ago • 10 comments

Currently it's hardcoded in trie/mod.rs, need to decide how to pass a config to trie code

mikhailOK avatar Dec 02 '19 22:12 mikhailOK

@evgenykuzyakov Did you add it to config with your limiters?

maxzaver avatar Jan 20 '20 05:01 maxzaver

@evgenykuzyakov Did you add it to config with your limiters?

Checked it. It's not.

lexfrl avatar Feb 26 '20 13:02 lexfrl

@mikhailOK I spent quite a time to find out how and where the computed memory usage is applied..

lexfrl avatar Feb 26 '20 17:02 lexfrl

@mikhailOK @nearmax

As far as I can see, memory_usage is stored in the node storage already with an applied TRIE_COSTS. To have an ability to apply new costs dynamically (in operating node), we should count raw values, but not the calculated ones and multiply them later. Correct?

Refs:

https://github.com/nearprotocol/nearcore/blob/ce11dfa277fe2c97ec7ccc9a417d28549358a757/core/store/src/trie/mod.rs#L60-L60

https://github.com/nearprotocol/nearcore/blob/ce11dfa277fe2c97ec7ccc9a417d28549358a757/core/store/src/trie/mod.rs#L86-L90

https://github.com/nearprotocol/nearcore/blob/ce11dfa277fe2c97ec7ccc9a417d28549358a757/core/store/src/trie/insert_delete.rs#L98-L98

https://github.com/nearprotocol/nearcore/blob/ce11dfa277fe2c97ec7ccc9a417d28549358a757/core/store/src/trie/mod.rs#L218-L244

lexfrl avatar Apr 10 '20 15:04 lexfrl

@mikhailOK why TRIE_COSTS should be in config? What config it should be?

lexfrl avatar Apr 10 '20 17:04 lexfrl

This issue has been automatically marked as stale because it has not had recent activity in the last 2 months. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 01 '21 11:07 stale[bot]

cc @nearmax @Longarithm looks like we still have this issue

bowenwang1996 avatar Jul 02 '21 16:07 bowenwang1996

This issue has been automatically marked as stale because it has not had recent activity in the last 2 months. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 30 '21 18:09 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity in the last 2 months. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Dec 30 '21 22:12 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity in the last 2 months. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 07 '22 02:04 stale[bot]