Skip to content
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

ext-costs moved to logic config extracted #1417

Merged
merged 12 commits into from
Oct 28, 2019
Merged

Conversation

lexfrl
Copy link
Contributor

@lexfrl lexfrl commented Oct 7, 2019

The goal is to remove duplication of RuntimeFees in wasm_config and in runtime_config (see testnet.json changes). Would be glad to get ideas on how to make it better..

Copy link
Contributor

@MaksymZavershynskyi MaksymZavershynskyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks logical. What concerns do you have?

@@ -1,13 +1,12 @@
use crate::types::Gas;
use near_runtime_fees::RuntimeFeesConfig;
use serde::{Deserialize, Serialize};
use std::collections::hash_map::DefaultHasher;
use std::hash::{Hash, Hasher};

#[derive(Clone, Debug, Hash, Serialize, Deserialize)]
pub struct Config {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to rename it to WasmConfig to make the code outside this crate easier to read.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VMConfig would be better I think.

@@ -85,8 +91,9 @@ fn test_max_register_memory_limit() {
let context = get_context(vec![], false);
let config = Config::free();
let promise_results = vec![];
let fees = RuntimeFeesConfig::default();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we have RuntimeFeesConfig::free() here?

@lexfrl lexfrl changed the base branch from fckt/ext-costs to staging October 22, 2019 17:36
@lexfrl lexfrl marked this pull request as ready for review October 22, 2019 17:37
@lexfrl lexfrl force-pushed the fckt/configs-refactoring branch 3 times, most recently from 49d9127 to 0edade4 Compare October 22, 2019 20:48
@lexfrl
Copy link
Contributor Author

lexfrl commented Oct 23, 2019

VMLogicBuilder was introduced as well to reduce setup boilerplate in tests.

Copy link
Contributor

@MaksymZavershynskyi MaksymZavershynskyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of reformating, check my comment on rustfmt

@@ -992,17 +994,7 @@ mod tests {
epoch_manager
.record_block_info(
&h[1],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you check whether you have https://github.com/nearprotocol/nearcore/blob/master/rustfmt.toml in ~/.config/rustfmt/ ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, I don't have ~/.config/rustfmt/ . I've started to use Idea, maybe that's why..

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI ~/.config/rustfmt/ is independent on IDE, it is just where rustfmt looks for config.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

of course. But who knows, maybe idea does more magic. But I checked it, rust fmt really wants to format it! You can check it by running cargo fmt check on staging branch.

@lexfrl lexfrl force-pushed the fckt/configs-refactoring branch 3 times, most recently from bd6717d to af1c002 Compare October 26, 2019 12:03
@lexfrl lexfrl merged commit 6a00875 into staging Oct 28, 2019
bowenwang1996 added a commit that referenced this pull request Oct 30, 2019
* 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)

* Introduced `chunk` API

* Saving genesis chunks to make consistent output from chunks RPC

* Bump near-vm-* to 0.3.1 (#1541)

* Nit
* Bump to 0.3.1
* Nit

* working coredump for docker (#1531)

* working coredump for docker
* Merge branch 'staging' into docker-coredump
* Merge refs/heads/staging into docker-coredump

* Update dependencies (#1532)

* Update dependencies

* Merge master into staging (#1534)

* 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)

* Remove all warnings (#1516)

* Add more bootnodes (#1525)

* Genesis csv to Genesis json tool + key generator (#1462)

* WIP
* Code to read token holders from the file
* Minimal code that reads genesis from csv and converts it to json
* Tool for generating key pairs
* Make csv-parser a runnable binary
* Merge
* Merge branch 'staging' into genesis-mainnet
* Merge
* Merge branch 'genesis-mainnet' of https://github.com/nearprotocol/nearcore into genesis-mainnet
* Merge branch 'staging' into genesis-mainnet
* Merge branch 'staging' into genesis-mainnet
* Nit
* Merge branch 'genesis-mainnet' of https://github.com/nearprotocol/nearcore into genesis-mainnet
* Merge branch 'staging' into genesis-mainnet
* Merge refs/heads/staging into genesis-mainnet
* Merge refs/heads/staging into genesis-mainnet
* Merge refs/heads/staging into genesis-mainnet
* Merge refs/heads/staging into genesis-mainnet
* Merge refs/heads/staging into genesis-mainnet
* Merge refs/heads/staging into genesis-mainnet
* Merge refs/heads/staging into genesis-mainnet
* Merge refs/heads/staging into genesis-mainnet
* Merge refs/heads/staging into genesis-mainnet
* Merge refs/heads/staging into genesis-mainnet
* Merge refs/heads/staging into genesis-mainnet
* Merge refs/heads/staging into genesis-mainnet
* Merge refs/heads/staging into genesis-mainnet
* Merge refs/heads/staging into genesis-mainnet
* Merge refs/heads/staging into genesis-mainnet
* Merge refs/heads/staging into genesis-mainnet
* Merge refs/heads/staging into genesis-mainnet
* Merge refs/heads/staging into genesis-mainnet
* Merge refs/heads/staging into genesis-mainnet

* Rpc transaction routing (#1544)

* Rpc transaction routing
* Transaction status routing
* Merge branch 'staging' into rpc-tx-routing
* Revert changes to runtime
* Fix test
* A python test for rpc tx forwarding
* fix pytest
* use SizedCache
* Add RequestRouted
Address comments

* Fix keypair generation problem when directory does not exist (#1556)

* Fix some issues related to genesis and running nodes (#1557)

* Do not always override bootnodes
* Add genesis time to Row
* bump rpc polling timeout to 10s

* toolchain set to nightly-2019-10-04 (#1539)

* Revert profile-overrides syntax after toolchain downgrade (#1558)

* Chaos Monkey now restarts nodes (#1554)

Two new modes in chaos monkey:
- `node_restart` ocasionally restarts one of the nodes that are initially running (but always just one)
- `node_set` maintains an extra set of nodes (which are initially shut down), and prediodically restarts them arbitrarily, ocasionally also wiping out their data folders.

* fix a few queries which was work for only one node by aggregate (#1563)

* fix a few queries which was work for only one node by aggregate
* Merge branch 'staging' into fix-dashboard

* Cargo bug workaround (#1564)

* Remove mock feature
* Bump versions
* Script to publish runtime packages
* Merge branch 'staging' into wasm32_fix

* Fix bad test in near-vm-logic (#1565)

* Fix bad test in near-vm-logic
* Merge refs/heads/staging into bad_test

* adding genesis tools for stakewars into dockerfile (#1567)

* adding genesis tools for stakewars into dockerfile
* Merge branch 'staging' into genesis-tool-docker
* Merge refs/heads/staging into genesis-tool-docker

* Fix unused return values in serialization (#1568)

* Fix unused return values in serialization
* Merge refs/heads/staging into bad_borsh

* Update borsh to 0.2.9 (#1566)

* Update borsh to 0.2.9
* Merge refs/heads/staging into update_borsh
* Merge refs/heads/staging into update_borsh
* Merge refs/heads/staging into update_borsh
* Merge refs/heads/staging into update_borsh

* update bootnode ip (#1569)

* update bootnode ip
* Merge branch 'staging' into update-bootnode
* Merge refs/heads/staging into update-bootnode

* Fix chunk producer kickout (#1571)

* Fix chunk producer kickout

* fix genesis

* fix initialization

* Script to start nodes for stakewars (#1572)

* Scripts to start nodes for stakewars

* change chain-id

* fix quotes

* do not override if genesis already exists

* ext-costs moved to logic config extracted (#1417)

* gas_counter moved to mod

* instrumented runtime with gas counter

* hash256 per-byte gas counting added

* block_timestamp test added and fix tests

* fix genesis config

* ext-costs moved to logic config extracted

* rename Config -> VMConfig

* #49: cargo fmt all & add CI check (#1574)

* Fix typo: Secp2561KSignature -> Secp256K1Signature (#1518)

* do not remove docker build to avoid sudo (#1583)

* do not remove docker build to avoid sudo

* Improve genesis tools (#1562)

* Improve genesis tools
* Merge refs/heads/staging into improve-genesis-tools
* Merge refs/heads/staging into improve-genesis-tools
* Merge refs/heads/staging into improve-genesis-tools
* Merge refs/heads/staging into improve-genesis-tools
* Merge refs/heads/staging into improve-genesis-tools
* extract verification code
* Merge branch 'staging' into improve-genesis-tools
* Merge branch 'staging' into improve-genesis-tools
* Merge refs/heads/staging into improve-genesis-tools

* Code ownership for genesis tools (#1584)

* Code ownership for genesis tools
* Merge branch 'staging' into genesis-ownerhsip

* Disable ban for abusing peers. (#1585)

* Add option to generate signer keys to file (#1587)
@ilblackdragon ilblackdragon deleted the fckt/configs-refactoring branch April 16, 2020 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants