-
Notifications
You must be signed in to change notification settings - Fork 623
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
Move rewards to runtime #1497
Move rewards to runtime #1497
Conversation
…rewards-to-runtime
apply_state: &ApplyState, | ||
prev_receipts: &[Receipt], | ||
transactions: &[SignedTransaction], | ||
) -> Result<ApplyResult, InvalidTxErrorOrStorageError> { | ||
// TODO(#1481): Remove clone after Runtime bug is fixed. | ||
let initial_state = state_update.clone(); | ||
let initial_state = TrieUpdate::new(trie.clone(), root); |
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.
@Kouprin Is working on trie parts. His abstraction requires encapsulating root in StateRoot
instead of exposing it as a hash directly. We might want to avoid working with root hashes directly in the runtime.
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.
I was wondered what exactly should be used here. Seems most places still use hash, so I decided to use the hash instead of the StateRoot
.
Right now TrieUpdate
takes hash for the root, so it's better to pass the hash for now.
Co-Authored-By: Maksym Zavershynskyi <35039879+nearmax@users.noreply.github.com>
…rewards-to-runtime
…rcore into move-rewards-to-runtime
* Move validator rewards to runtime * Merge branch 'staging' of github.com:nearprotocol/nearcore into move-rewards-to-runtime * Merge branch 'staging' of github.com:nearprotocol/nearcore into move-rewards-to-runtime * Update runtime/runtime/src/lib.rs Co-Authored-By: Maksym Zavershynskyi <35039879+nearmax@users.noreply.github.com> * Merge branch 'staging' of github.com:nearprotocol/nearcore into move-rewards-to-runtime * Merge branch 'move-rewards-to-runtime' of github.com:nearprotocol/nearcore into move-rewards-to-runtime * Merge branch 'staging' into move-rewards-to-runtime * Merge refs/heads/staging into move-rewards-to-runtime
* Dont panic for check balance (#1493) * Introduce BalanceMismatch error * Merge branch 'staging' of github.com:nearprotocol/nearcore into dont-panic-for-check-balance * Merge branch 'staging' of github.com:nearprotocol/nearcore into dont-panic-for-check-balance * Merge bug * Merge branch 'staging' into dont-panic-for-check-balance * Merge refs/heads/staging into dont-panic-for-check-balance * Merge refs/heads/staging into dont-panic-for-check-balance * Merge refs/heads/staging into dont-panic-for-check-balance * Merge branch 'staging' of github.com:nearprotocol/nearcore into dont-panic-for-check-balance * Merge branch 'dont-panic-for-check-balance' of github.com:nearprotocol/nearcore into dont-panic-for-check-balance * Merge master into staging (#1511) * Give more money to test.near (#1467) * Give more money to test.near * Bump version * Reset state and bump version (#1499) * Bump version for Borsh (#1502) * Fix boot node in start_testnet.py (#1505) * Reduce total supply and adjust parameters (#1508) * Update dependency to avoid vulnerabilities (#1509) * Update dependency to avoid vulnerabilities * Remove serde_cbor * pytest for remote node (#1437) * gcloud lib and init/start cluster * Merge branch 'staging' into pytest-remote * a few fixes * almost done * a few more fix * Merge branch 'staging' into pytest-remote * more fix * more tests * more fix and tests * Merge branch 'staging' into pytest-remote * Merge branch 'staging' into pytest-remote * Merge refs/heads/staging into pytest-remote * Merge refs/heads/staging into pytest-remote * Merge refs/heads/staging into pytest-remote * Merge refs/heads/staging into pytest-remote * Merge refs/heads/staging into pytest-remote * Merge refs/heads/staging into pytest-remote * Merge refs/heads/staging into pytest-remote * Merge branch 'staging' into pytest-remote * Merge branch 'staging' into pytest-remote * add requirements.txt * a few fixes * remote version of block_production works * Merge branch 'pytest-remote' of github.com:nearprotocol/nearcore into pytest-remote * Merge branch 'staging' into pytest-remote * update requirements.txt * Remove some unnecessary unsafe code (#1512) * Remove some unnecessary unsafe code * Merge refs/heads/staging into remove-unsafe-code * Merge refs/heads/staging into remove-unsafe-code * Chaos Monkey now messes up with network (#1514) * Chaos Monkey now messes up with network * Fixing a typo * Adding missing shell command * Marking `local_network` monkey as existing * Adding one of the new tests that was previously missing * Handle head method for status check (#1513) * fix head status check * Merge branch 'staging' into handle-head-method * Merge refs/heads/staging into handle-head-method * Merge refs/heads/staging into handle-head-method * recover system coredump by Misha for minimize docker image (#1528) * recover system coredump by Misha for minimize docker image * Move rewards to runtime (#1497) * Move validator rewards to runtime * Merge branch 'staging' of github.com:nearprotocol/nearcore into move-rewards-to-runtime * Merge branch 'staging' of github.com:nearprotocol/nearcore into move-rewards-to-runtime * Update runtime/runtime/src/lib.rs Co-Authored-By: Maksym Zavershynskyi <35039879+nearmax@users.noreply.github.com> * Merge branch 'staging' of github.com:nearprotocol/nearcore into move-rewards-to-runtime * Merge branch 'move-rewards-to-runtime' of github.com:nearprotocol/nearcore into move-rewards-to-runtime * Merge branch 'staging' into move-rewards-to-runtime * Merge refs/heads/staging into move-rewards-to-runtime * Fix a dependency (#1527) * Fix a dependency eth-secp256k1 got renamed to parity-secp256k1 * Merge refs/heads/staging into fix_build * update rust-toolchain (#1529) * update rust-toolchain * Fix some warnings (#1530) * Fix some warnings * More warnings * Introduced `chunk` API (#1524
.apply
API to avoidclone
issue.clone
issue.Fixes #1481