* Introduce `BlockExectionWeight` and `ExtrinsicBaseWeight`
* Add new traits everywhere
* Missed one update
* fix tests
* Update `check_weight` logic
* introduce `max_extrinsic_weight` function
* fix + add tests
* format nits
* remove println
* make test a bit more clear
* Remove minimum weight
* newlines left over from find/replace
* Fix test, improve clarity
* Fix executor tests
* Extrinsic base weight same as old `MINIMUM_WEIGHT`
* fix example test
* Expose constants
* Add test for full block with operational and normal
* Initiate test environment with `BlockExecutionWeight` weight
* format nit
* Update frame/system/src/lib.rs
Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
* Replace `TransactionBaseFee` with `ExtrinsicBaseWeight` (#5761)
* Replace `TransactionBaseFee` with `ExtrinsicBaseFee`
* Fix stuff
* Fix and make tests better
* Forgot to update this test
* Fix priority number in test
* Remove minimum weight from merge
* Fix weight in contracts
* remove `TransactionBaseFee` from contract tests
* Let `register_extra_weight_unchecked` go past `MaximumBlockWeight`
* address feedback
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Instead of logging value-found-event-handling failures or value-put
failures on error level, log them on debug level only additionally
recording them via Prometheus.
Motivation is that both events can happen in "normal" operations and
thus clutter the logs.
* add old_registrar_count as param to estimate weight
* cast count to Weight
Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>
* add weight calculation for set_identity
* remove superfluous weight comment
* add detailed weight estimation for set_subs
* adjust benchmarking code to the new API
* add second parameter to set_subs benchmark
* rename o to p
* calculate weight based on benchmarks
* use try_mutate for registrars
* fix weight number typo
* update weights for set_subs + add weights for clear_identity and request_judgement
* improve naming and docs
* add weight calculation for cancel_request
* fix benchmark
* fix tests
* fix arithmetic overflow in balances triggered by tests
* add weight calcluations for more dispatchables
* add weight calculation for provide_judgement
* mark param as unused
* add MaxRegistrars associated type used for weight estimation
* check that MaxRegistrars is not exceeded
* add remaining weight calculations
* use weight refunds to use more constants in weight estimation
* adjust usage of clear_identity
* refund request_judgement weights and remove param
* refund weights for cancel_request and remove param
* add remaining refunds and remove params
* refund weight for set_subs and remove param
* make comment more specific
* add range note to benchmarking docs
* fix inconsistencies before review
* fix actual weight calculation for add_registrar
* remove duplicate balance ops weights + refund on all dispatchables
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
* babe: support online configuration upgrades
* Switch to use NextConfigDescriptor instead of changing runtime interface
* Fix tests
* epoch-changes: map function that allows converting with different epoch types
* Add migration script for the epoch config change
* Fix migration tests
* Fix migration: Epoch should be EpochV0
* Update client/consensus/babe/src/lib.rs
Co-Authored-By: André Silva <123550+andresilva@users.noreply.github.com>
* Fix new epochChanges version
* Fix unused imports
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* transition treasury to configurable moduleids
* make election module id configurable
* convert runtime and pallet to accept module id config elections-phragmen
* add ModuleId to evm pallet
* change society pallet to configurable module id
* delete commented out module_id
* delete commented out code and merge in upstream master
* try and convert 4 whitespace to tab
* fix remaining space to tab conversions
* trivial cleaning
* delete comment from elections-phragrems tests
* trivial
* Update frame/elections-phragmen/src/lib.rs
* add docs for elections and elections phragmen
* make has_lock test get moduleid dynamically
* Apply suggestions from code review
Co-Authored-By: Amar Singh <asinghchrony@protonmail.com>
* make sure get is imported to evm
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Amar Singh <asinghchrony@protonmail.com>
Co-authored-by: Benjamin Kampmann <ben@gnunicorn.org>
* Fix error message when providing an incorrect peer-id
* Fix error message to cover all cases
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
* client/network-gossip/src/state_machine: Add unit test for on_incoming
Add two unit tests to ensure `on_incoming` is ingoring discarded
messages and reports and ignores messages from unknown peers.
* client/network-gossip/state_machine: Reduce indentation level
* client/network-gossip/bridge: Remove unnecessary into_iter
* client/network-gossip/state_machine: Report success after register check
* client/network-gossip/state_machine: Error not report on unregistered
`peers` contains all the peers we're connected to. If we receive a
message from a peer not in this list, that means there's an internal
problem within the local client. It's not the fault of the peer in
question.
With the above in mind instead of reducing the reputation of such peer,
log an error.
* network: Only insert global addresses into the DHT.
Currently every address reported via libp2p-identify is inserted into
the DHT which thus contains a multitude of unreachable addresses such
as from 127.0.0.0/8 or 10.0.0.0/8.
Issue #5099 suggested a dedicated service over UDP to gauge the
reachability of an address, which would however incur extra I/O costs
and be of limited use.
As an alternative and simpler tactic, this PR only allows global IP
addresses to be inserted into the DHT unless an explicit command-line
flag `--allow-non-global-addresses-in-dht` is given or a node is
started with `--dev`. This opt-in behaviour is meant to allow
site-local networks to still make use of a DHT.
* Enable non-global in more test setups.
* Replace command-line option with different name.
* Another test fix.
* Require `fn` token in `decl_storage` `get`
The `fn` token was already for quite some time as an optional parameter.
It was introduced to make these functions better findable. This pr makes
the `fn` token required.
* Remove `GetterNoFnkeyword`