Skip to content
This repository was archived by the owner on Jul 4, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
482 commits
Select commit Hold shift + click to select a range
eaab146
Fix #7629 (#7680)
tomaka Dec 7, 2020
f91998e
Update Cargo.toml (#7627)
kianenigma Dec 7, 2020
ec55d65
Make sure the companion CI test fails on any error (#7683)
bkchr Dec 7, 2020
163412d
implement more convertion on NumberOrHex (#7682)
gui1117 Dec 8, 2020
332399d
Streamline frame_system weight parametrization (#6629)
tomusdrw Dec 8, 2020
f9d9382
client: remove duplicate implementation of block_status (#7694)
andresilva Dec 8, 2020
4c0779e
Pin md link checker's version (#7697)
TriplEight Dec 8, 2020
609efdb
Remove waterfall CI trigger (#7519)
TriplEight Dec 8, 2020
d877123
add an upgrade_keys method for pallet-session (#7688)
rphmeier Dec 8, 2020
469836f
Allow capping the amount of work performed when deleting a child trie…
athei Dec 9, 2020
4b8c862
benchmarks: Fix panic in case of a missing model (#7698)
shawntabrizi Dec 9, 2020
9599f39
Expand remote keystore interface to allow for hybrid mode (#7628)
gnunicorn Dec 9, 2020
be8fd05
fork-tree: expose silent failures of is_descendent_of (#7695)
andresilva Dec 9, 2020
661bbc9
Merkle Mountain Range pallet (#7312)
tomusdrw Dec 9, 2020
9d843c3
frame/staking/README: Fix broken link (#7703)
mxinden Dec 9, 2020
6b600cd
*: Update to libp2p v0.32.0 (#7696)
mxinden Dec 9, 2020
1282327
*: Update to libp2p v0.32.2 (#7708)
mxinden Dec 10, 2020
b1ef770
kilt&polimec ss58 prefix (#7547)
weichweich Dec 10, 2020
2a7a985
Fix docs (#7710)
gui1117 Dec 10, 2020
d663ca5
Update md link checker (#7709)
TriplEight Dec 11, 2020
8bf9557
Fix PerThing::from_percent. (#7701)
kianenigma Dec 11, 2020
ea48d6b
Support Multiple Instances with Benchmarks (#7669)
shawntabrizi Dec 11, 2020
533bbbd
Add keccak-512 to host functions. (#7531)
tomusdrw Dec 11, 2020
445fa2d
Update debug.rs (#7721)
kianenigma Dec 12, 2020
557a9b8
Avoid too high values. (#7716)
tomusdrw Dec 14, 2020
956ccbc
Bump hyper from 0.12.35 to 0.13.9 (#7569)
dependabot[bot] Dec 14, 2020
1f49b2a
Prevent dust in staking by disallowing cheap bond_extra (#7718)
kianenigma Dec 14, 2020
d4d6844
Default block announce validation should reject additional data (#7726)
bkchr Dec 14, 2020
c88b104
Fix wrong order of values in log line (#7728)
tomaka Dec 14, 2020
dac7ff1
Fix polkadot companion test (#7732)
bkchr Dec 15, 2020
31499cd
remove duplicate accounts in chain-spec. (#7725)
kianenigma Dec 15, 2020
ba2fc2b
Participating in Council Governance is Free for First Time Voters and…
shamb0 Dec 15, 2020
6584375
Bump zeroize from 1.1.1 to 1.2.0 (#7731)
dependabot[bot] Dec 15, 2020
566ad03
Leave some header related info for inspection (#7727)
pepyakin Dec 15, 2020
987a972
Issue 7143 | Refactor Treasury Pallet into Bounties, Tips, and Propos…
shamb0 Dec 16, 2020
032bd12
CI: buildah to build images (#7741)
TriplEight Dec 17, 2020
2bc674a
optimize arithmetic cargo path (#7745)
honeywest Dec 17, 2020
fec28e1
optimize runtime-interface cargo path (#7729)
honeywest Dec 17, 2020
ad054e6
delete primitives in Cargo in primitives (#7751)
honeywest Dec 17, 2020
36d6433
delete client in Cargo in client (#7752)
honeywest Dec 17, 2020
039d3ff
prevent too many genesis council members (#7749)
kianenigma Dec 17, 2020
330f5c0
Update common block in sync after importing blocks of a peer, please …
bkchr Dec 18, 2020
aa5184d
Remove unnecessary parameter from sync (#7761)
bkchr Dec 18, 2020
94c34f3
Improve `InvalidTransaction::AncientBirthBlock` doc comment (#7743)
emostov Dec 19, 2020
61cb65e
Switch back to the crates.io release of trybuild (#7764)
bkchr Dec 19, 2020
8b9a441
No longer put keys back manually after a failed restoration (#7747)
athei Dec 19, 2020
3c531e2
Fix UI Tests (#7722)
shawntabrizi Dec 19, 2020
532cce0
update substrate to sc in docs (#7767)
honeywest Dec 21, 2020
9e2d7b7
Allow Staking tests to run with session length other than 1 (#7719)
kianenigma Dec 21, 2020
48bf02a
optimize biguint div closure (#7754)
honeywest Dec 21, 2020
22b34bb
Make it possible to calculate the storage root as often as you want (…
bkchr Dec 21, 2020
5c70d7b
Typo fix: eror => error (#7773)
Swader Dec 21, 2020
37a7727
Adds `try_get` for `StorageMap` and `StorageDoubleMap` (#7774)
bkchr Dec 22, 2020
6022575
Add account prefix for Valiu (#7776)
olanod Dec 23, 2020
3c5bfc0
Feat support weight test (#7769)
honeywest Dec 23, 2020
0d6953c
Add `pallet` attribute macro to declare pallets (#6877)
gui1117 Dec 24, 2020
281f81c
add a `current_epoch` to BabeApi (#7789)
rphmeier Dec 27, 2020
165b4b5
Update tests.rs (#7784)
IAliceBobI Dec 27, 2020
6ba867a
add a slot-duration getter to babe config (#7793)
rphmeier Dec 28, 2020
54bde60
Fix base-path handling in `key insert` (#7775)
bkchr Dec 28, 2020
264cfcf
Lazily evaluate error string (#7802)
JoshOrndorff Dec 29, 2020
f36ae22
contracts: Change `define_env!` to expect a `Result<T, DispatchError>…
athei Dec 29, 2020
7c9f9a5
Hex Balance deserialize for contracts_call RPC (#7807)
jacogr Dec 29, 2020
5d5a3b8
Don't allow self proxies (#7803)
shawntabrizi Dec 29, 2020
f1d8be8
Allow council to slash treasury tip (#7753)
shamb0 Dec 29, 2020
6abbbd6
Add CLI argument to disable log color output (#7795)
bkchr Dec 29, 2020
67c8cad
Use path instead of ident (#7809)
shawntabrizi Dec 30, 2020
b442214
Add proper `commit_all` to `TestExternalities` (#7808)
bkchr Dec 30, 2020
0fc8329
Define ss58 prefix inside the runtime (#7810)
athei Dec 30, 2020
2eaeb91
remove some unecessary bound (#7813)
gui1117 Jan 1, 2021
e8a8301
Fix ss58check test when executed with other tests (#7815)
bkchr Jan 3, 2021
5215cd7
Cleanup some warnings (#7816)
andresilva Jan 3, 2021
9b08105
Happy new year (#7814)
bkchr Jan 4, 2021
d972eb1
contracts: Allow runtime authors to define a chain extension (#7548)
athei Jan 4, 2021
28ffe37
*: Update to libp2p v0.33.0 (#7759)
mxinden Jan 4, 2021
fcdba68
contracts: Lazy storage removal (#7740)
athei Jan 4, 2021
3a904bb
fix template (#7823)
gui1117 Jan 4, 2021
30009d9
rename HEADER files so that they are consistent with LICENSE filename…
andresilva Jan 5, 2021
91dd683
contracts: Prevent contracts from allocating a too large buffer (#7818)
athei Jan 5, 2021
80d7559
Improve error message on where clause on pallet error (#7821)
gui1117 Jan 5, 2021
4dcde7e
Feat sp keystore (#7826)
honeywest Jan 5, 2021
0091c09
minor fix (#7828)
kaichaosun Jan 5, 2021
1b840aa
Participation Lottery Pallet (#7221)
shawntabrizi Jan 5, 2021
dbe2031
client/network: Use request response for block requests (#7478)
mxinden Jan 5, 2021
a2ee0b4
fix : remove `_{ }` syntax from benchmark macro (#7822)
stanly-johnson Jan 6, 2021
170eed5
Improve spans of pallet macro (#7830)
gui1117 Jan 6, 2021
71e47d7
Fix master build (#7837)
bkchr Jan 6, 2021
8927543
babe: expose next epoch data (#7829)
andresilva Jan 6, 2021
762f4b0
contracts: Add configurable per-storage item cost (#7819)
athei Jan 6, 2021
e5e7606
upgrade a few dependencies (#7831)
Jan 6, 2021
698d80b
CI: remove squash and fix buildah push (#7841)
TriplEight Jan 6, 2021
b275035
Fix incorrect use of syn::exports (#7838)
bkchr Jan 6, 2021
08a6009
Subkey should not import the entire world. (#7845)
bkchr Jan 7, 2021
c9d9365
Rework priority groups, take 2 (#7700)
tomaka Jan 7, 2021
9c5fc1c
Better Handle Dead Accounts in Balances (#7843)
shawntabrizi Jan 7, 2021
885c1f1
bump fs-swap (#7834)
xlc Jan 8, 2021
df287fe
UniArts reserve SS58 address id 38 (#7651)
tuminfei Jan 8, 2021
c8dd406
Update to futures 0.3.9 (#7854)
tomaka Jan 8, 2021
d1923a4
Store dispatch info of calls locally in weight calculation (#7849)
shawntabrizi Jan 8, 2021
5f3db33
client/network: Re-enable light_client_handler.rs unit tests (#7853)
mxinden Jan 8, 2021
fa40416
Fix max log level (#7851)
bkchr Jan 8, 2021
7120851
Fix missing network for uniarts (#7859)
bigxiang Jan 9, 2021
0fd461c
contracts: Collect rent for the first block during deployment (#7847)
athei Jan 11, 2021
00b41bc
Merge 2.0.1 backport branch into mainline master (#7842)
Xanewok Jan 11, 2021
f6ca02d
Bump cargo-unleash to latest alpha release (#7867)
gnunicorn Jan 11, 2021
8b3e4c8
Bump sha2 from 0.8.2 to 0.9.2 (#7643)
dependabot[bot] Jan 11, 2021
b2f10ed
bumpd minor version (#7873)
gui1117 Jan 12, 2021
af88571
Add Prometheus alerts if unbounded channels are too large (#7866)
tomaka Jan 12, 2021
f977fb8
Bump retain_mut from 0.1.1 to 0.1.2 (#7869)
dependabot[bot] Jan 12, 2021
7a52a74
babe: initialize next authorities on genesis (#7872)
andresilva Jan 12, 2021
928b735
Update serde and parity-multiaddr, to fix master CI (#7877)
tomaka Jan 12, 2021
ecb85f7
Add ss58 version prefix for CORD (from Dhiway) (#7862)
smohan-dw Jan 12, 2021
b2a5019
network-gossip: add metric for number of local messages (#7871)
andresilva Jan 12, 2021
82d97c8
Clean-up pass in network/src/protocol.rs (#7889)
tomaka Jan 13, 2021
05e5892
contracts: Don't read the previous value when overwriting a storage i…
athei Jan 13, 2021
aa8b7db
Fix clear prefix check to avoid erasing child trie roots. (#7848)
cheme Jan 13, 2021
559e56b
CI: test prometheus alerts moved to check; deploy depends on tests; c…
TriplEight Jan 13, 2021
1334eb7
pallet_authority_discovery: introduce current_authorities and next_au…
Jan 13, 2021
c2aa425
make helper error types generics (#7878)
drahnr Jan 13, 2021
f2367f7
Add payment_queryFeeDetails RPC (#7692)
liuchengxu Jan 14, 2021
fae26bb
Use checked math when calculating storage size (#7885)
athei Jan 14, 2021
1c9a9e4
contracts: Cap the surcharge reward by the amount of rent that way pa…
athei Jan 14, 2021
a962daa
Update the Grafana dashboards (#7886)
tomaka Jan 14, 2021
a9bbc7b
Log target before prefix for more consistent logging (#7897)
bkchr Jan 14, 2021
d0b2e7d
contracts: Fix failing benchmark test (#7900)
athei Jan 14, 2021
f1c6725
CI: trigger simnet master and wait for status (#7899)
TriplEight Jan 14, 2021
8ee55dd
Storage chains part 1 (#7868)
arkpar Jan 14, 2021
e6d498a
tests: fix UI test so we can update CI image (#7901)
TriplEight Jan 14, 2021
bb3435a
*: Update to libp2p v0.34.0 (#7888)
mxinden Jan 15, 2021
53fbef5
Fix bad debug_assert (#7904)
tomaka Jan 15, 2021
bfd6826
fix template (#7905)
gui1117 Jan 15, 2021
ab10fb5
improve benchmarking error output (#7863)
ropottnik Jan 15, 2021
caeb3b9
Fix not restoring non-poisoned state (#7906)
tomaka Jan 15, 2021
23ece2f
Add Test for Variable Components in Benchmarking (#7902)
shawntabrizi Jan 15, 2021
946c0e1
fix cargo fmt (#7907)
honeywest Jan 15, 2021
cfb8157
Add ss58 version prefix for Patract/Jupiter (from PatractHubs) (#7785)
atenjin Jan 15, 2021
7a79f54
Introduces account existence providers reference counting (#7363)
gavofyork Jan 16, 2021
d3673c2
fix clippy error (#7912)
honeywest Jan 17, 2021
d42240b
Allow configuring Yamux window size (#7916)
tomaka Jan 18, 2021
4ac74e9
Decouple Stkaing and Election - Part1: Support traits (#7908)
kianenigma Jan 18, 2021
2679599
Feat suppert procedural (#7913)
honeywest Jan 18, 2021
8aa9281
Expose BountyUpdatePeriod. (#7921)
krzysztof-jelski Jan 18, 2021
74a50ab
Add ss58 version prefix for Litentry (#7918)
Satoshi-Kusumoto Jan 18, 2021
cde8232
Address review comments of #7916 (#7917)
tomaka Jan 18, 2021
2b47773
Update details for the Polymesh network (#7919)
adamdossa Jan 18, 2021
6c14fac
Update ss58 registry for Robonomics (#7923)
ensrationis Jan 18, 2021
e3b6315
babe: log block and slot number on verification (#7920)
andresilva Jan 18, 2021
b64ec19
Add explicit limits to notifications sizes and adjust yamux buffer si…
tomaka Jan 19, 2021
e813f62
Freeze Assets and Asset Metadata (#7346)
shawntabrizi Jan 19, 2021
61fa641
Increase UnboundedChannelVeryLarge threshold from 5k to 15k (#7931)
tomaka Jan 19, 2021
2d5a75d
Sync: Propagate block announcement data (#7903)
bkchr Jan 19, 2021
a9ed67e
Disable Nagle algorithm (#7932)
tomaka Jan 20, 2021
4868630
Migrate frame-system to pallet attribute macro (#7898)
ascjones Jan 20, 2021
8f43280
Telemetry per node (#7463)
cecton Jan 20, 2021
2a5e10a
Allow validators to block and kick their nominator set. (#7930)
gavofyork Jan 20, 2021
d5bdd81
Fix elections-phragmen and proxy issue (#7040)
kianenigma Jan 20, 2021
1baeefa
.maintain: Replace sentry-node with local-docker-test-network (#7943)
mxinden Jan 21, 2021
a7fd1e5
Attempt to remove the `where` bounds in arithmetic. (#7933)
kianenigma Jan 21, 2021
3e870d1
Minor contributor docs update (#7948)
gnunicorn Jan 21, 2021
d9e56ef
Make offchain indexing work (#7940)
bkchr Jan 21, 2021
4b687df
Grandpa warp sync request-response protocol (#7711)
expenses Jan 21, 2021
bd5c9a6
Cleaner GRANDPA RPC API for proving finality (#7339)
octol Jan 21, 2021
947a6bc
Allow transaction for offchain indexing (#7290)
cheme Jan 22, 2021
ba50a59
Enable sync mode for paritydb (#7961)
arkpar Jan 24, 2021
aaba404
Very minor typo in the docs (#7967)
g2udevelopment Jan 25, 2021
bb0fb29
Remove hidden item NonExhaustive in syn crate (#7969)
sorpaas Jan 25, 2021
13c75ae
Detect conflicting module names in `construct_runtime!` (#7968)
bkchr Jan 25, 2021
67e6000
pallet minor doc improvment (#7922)
gui1117 Jan 25, 2021
dd173ae
Make pallets use construct_runtime (#7950)
gui1117 Jan 25, 2021
38f723b
client/network/req-resp: Prevent request id collision (#7957)
mxinden Jan 25, 2021
2b43895
use construct_runtime for more pallet (#7974)
gui1117 Jan 25, 2021
65003c5
Migrate some more pallets to construct_runtime (#7975)
ascjones Jan 25, 2021
51d2312
Pallet proc macro doc improvements (#7955)
ascjones Jan 25, 2021
13cdf1c
Refuse to start substrate without providing an explicit chain (#7977)
dvdplm Jan 25, 2021
addf203
client/network: Report reputation changes via response (#7958)
mxinden Jan 26, 2021
4888ac6
Migrate pallet-template to pallet attribute macro (#7981)
g2udevelopment Jan 26, 2021
bc3075c
Fix Network trait implementation not doing what it's supposed to do (…
tomaka Jan 26, 2021
46c510f
Make pallet use construct_runtime in tests instead of impl_* (#7986)
gui1117 Jan 26, 2021
e82518b
Rewrite the async code in `BasicQueue` (#7988)
bkchr Jan 26, 2021
1490be7
grandpa: remove runtime checks in prove_finality (#7953)
octol Jan 26, 2021
d0723f1
Ensure transactional with ? works in frame v2 (#7982)
gui1117 Jan 26, 2021
c003a48
Increase maximum size of transaction notifications (#7993)
tomaka Jan 27, 2021
9c0ae89
Let mock in pallet-template use construct_runtime (#7991)
g2udevelopment Jan 27, 2021
0b0d124
Fix state cache for cumulus (#7990)
arkpar Jan 27, 2021
2d597fc
Merkle Mountain Range pallet improvements (#7891)
tomusdrw Jan 28, 2021
64df2f9
Introduce a `Slot` type (#7997)
bkchr Jan 28, 2021
68d7157
Clarify and expand ProvideInherent docs (#7941)
JoshOrndorff Jan 28, 2021
ae3dabb
Introduce sc_peerset::DropReason (#7996)
tomaka Jan 29, 2021
a51a988
Doc fixes for sc-telemetry & API struct rename (#7934)
cecton Jan 29, 2021
1d5d13a
Fix telemetry span not entering properly & enter span in sc-cli (#7951)
cecton Jan 29, 2021
93b231e
Update parity-scale-codec to 2.0 (#7994)
gui1117 Jan 29, 2021
caff191
Test is_inherent_required (#8002)
4meta5 Jan 29, 2021
9659509
Sync: Fix issue of not freeing a block announcement slot (#8006)
bkchr Jan 29, 2021
a45e3f2
CI: return flaming fir deployment (#8007)
TriplEight Jan 29, 2021
30ec0be
chore: fix typos (#8013)
yjhmelody Feb 1, 2021
017a9a0
Fix tracing spans are not being forwarded to spawned task (#8009)
bkchr Feb 1, 2021
043cb0a
make AllModules public (#8017)
apopiak Feb 1, 2021
5a5f06e
client/network: Use request response for light client requests (#7895)
mxinden Feb 1, 2021
b7fc46d
relax translate closure to FnMut (#8019)
apopiak Feb 1, 2021
26f3d68
Remove outdated Grafana information (#8012)
tomaka Feb 1, 2021
b201d7c
contracts: Emit event on contract termination (#8014)
athei Feb 2, 2021
7cb5eed
Fix tracing tests (#8022)
bkchr Feb 2, 2021
aaf6598
contracts: Improve documentation (#8018)
athei Feb 2, 2021
d5b0856
Disable Kademlia random walk when --reserved-nodes is passed (#7999)
tomaka Feb 2, 2021
81ca765
Convert AURA to new pallet macro (#8020)
bkchr Feb 2, 2021
bc69520
Rename system_networkState to system_unstable_networkState (#8001)
tomaka Feb 2, 2021
075796f
Decouple the session validators from im-online (#7127)
liuchengxu Feb 2, 2021
c7f52d1
better formatting for doc comments (#8030)
JoshOrndorff Feb 2, 2021
5a94966
Add a send_request function to NetworkService (#8008)
eskimor Feb 2, 2021
56c64cf
Storage chains: serve transactions over IPFS/bitswap (#7963)
arkpar Feb 3, 2021
9d7b884
Improve log line (#8032)
tomaka Feb 3, 2021
2fb4534
Export `IfDisconnected` in public module. (#8034)
eskimor Feb 3, 2021
9b40d50
frame-system: Index type 'MaybeSerializeDeserialize' bound. (#8035)
shaunxw Feb 3, 2021
f80d23b
contracts: Make ChainExtension trait generic over the runtime (#8003)
athei Feb 3, 2021
840478a
AURA: Switch to `CurrentSlot` instead of `LastTimestamp` (#8023)
bkchr Feb 3, 2021
dc02c65
contracts: Charge rent for code storage (#7935)
athei Feb 4, 2021
169b16f
Migrate assets pallet to new macros (#7984)
dvdplm Feb 4, 2021
85c479f
babe, grandpa: cleanup stale equivocation reports (#8041)
andresilva Feb 4, 2021
05eb8d9
move some pallet test to use construct_runtime (#8049)
gui1117 Feb 4, 2021
6105169
Migrate more pallet tests to construct_runtime (#8051)
ascjones Feb 4, 2021
a675f9a
Update dependencies ahead of next release (#8015)
gnunicorn Feb 4, 2021
3c9b031
transaction-pool: drop unpropagable txs if local node cant author blo…
andresilva Feb 4, 2021
cc71cca
Fix some problems with `prove_warp_sync` (#8037)
expenses Feb 5, 2021
09ba69f
CheckSpecVersion reference fix (#8056)
al3mart Feb 5, 2021
f14488d
contracts: Remove ConfigCache (#8047)
athei Feb 5, 2021
26e9a11
Extend SS58 network identifiers (#8039)
gavofyork Feb 6, 2021
0b719f8
Use construct_runtime in tests (#8059)
gui1117 Feb 6, 2021
bbc7b0e
Bump wasmtime from 0.19.0 to 0.22.0 (#7865)
dependabot[bot] Feb 8, 2021
29aca98
Remove backwards-compatibility networking hack (#8068)
tomaka Feb 8, 2021
07a5f29
Switch to latest `impl-trait-for-tuples` (#8082)
bkchr Feb 9, 2021
66cfa92
Add Crust Network SS58 Address (#8064)
badkk Feb 9, 2021
077c480
Add Ares SS58 address type (#8061)
jiyilanzhou Feb 9, 2021
273bc7b
Replace last usages of `<() as PalletInfo>` in substrate (#8080)
gui1117 Feb 9, 2021
4777aba
Remove PalletInfo impl for () (#8090)
ascjones Feb 9, 2021
48e9d49
WasmExecutor takes a cache directory (#8057)
pepyakin Feb 9, 2021
9c5da5c
Add Aventus ss58 address (#8050)
nahuseyoum Feb 9, 2021
28b950e
sc-network: switch on default features for libp2p on non-wasm-builds …
gnunicorn Feb 10, 2021
91a7418
pallet macro: easier syntax for `#[pallet::pallet]` with `struct Pall…
gui1117 Feb 10, 2021
90c9706
Pallet attribute macro migrate guidelines minor fixes (#8094)
shaunxw Feb 10, 2021
90bb153
Switch to use `diener patch` for companion build (#8073)
bkchr Feb 10, 2021
22441aa
Migrate pallet-balances to pallet attribute macro (#7936)
ascjones Feb 10, 2021
ce018b8
babe, grandpa: set longevity for equivocation report transactions (#8…
andresilva Feb 10, 2021
ba290e0
Migrate pallet-timestamp to pallet attribute macro. (#8078)
shaunxw Feb 10, 2021
12562bb
Use log level error to report telemetry (#8097)
cecton Feb 10, 2021
49a4103
Releasing 3.0 (#8098)
gnunicorn Feb 10, 2021
b146091
Merge remote-tracking branch 'upstream/master' into develop
jordy25519 Feb 11, 2021
96734f1
Merge remote-tracking branch 'upstream/master' into develop
jordy25519 Feb 11, 2021
d5cc623
Add missing weights files
jordy25519 Feb 11, 2021
1c4bf89
Update tests/compile
jordy25519 Feb 14, 2021
2bb930d
rust 1.49.0 for test build
jordy25519 Feb 15, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
contracts: Lazy storage removal (#7740)
* Do not evict a contract from within a call stack

We don't want to trigger contract eviction automatically when
a contract is called. This is because those changes can be
reverted due to how storage transactions are used at the moment.
More Information:
paritytech/substrate#6439 (comment)

It can be re-introduced once the linked issue is resolved. In the meantime
`claim_surcharge` must be called to evict a contract.

* Lazily delete storage in on_initialize instead of when removing the contract

* Add missing documentation of new error

* Make Module::claim_surcharge public

It being the only dispatchable that is private is an oversight.

* review: Add final newline

* review: Simplify assert statement

* Add test that checks that partial remove of a contract works

* Premote warning to error

* Added missing docs for seal_terminate

* Lazy deletion should only take AVERAGE_ON_INITIALIZE_RATIO of the block

* Added informational about the lazy deletion throughput

* Avoid lazy deletion in case the block is already full

* Prevent queue decoding in case of an already full block

* Add test that checks that on_initialize honors block limits
  • Loading branch information
athei authored Jan 4, 2021
commit fcdba68bc7b6bbc960bdfb326e2a706d580aa8a0
12 changes: 12 additions & 0 deletions bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ pub use pallet_transaction_payment::{Multiplier, TargetedFeeAdjustment, Currency
use pallet_session::{historical as pallet_session_historical};
use sp_inherents::{InherentData, CheckInherentsResult};
use static_assertions::const_assert;
use pallet_contracts::WeightInfo;

#[cfg(any(feature = "std", test))]
pub use sp_runtime::BuildStorage;
Expand Down Expand Up @@ -716,6 +717,15 @@ parameter_types! {
pub const MaxDepth: u32 = 32;
pub const StorageSizeOffset: u32 = 8;
pub const MaxValueSize: u32 = 16 * 1024;
// The lazy deletion runs inside on_initialize.
pub DeletionWeightLimit: Weight = AVERAGE_ON_INITIALIZE_RATIO *
RuntimeBlockWeights::get().max_block;
// The weight needed for decoding the queue should be less or equal than a fifth
// of the overall weight dedicated to the lazy deletion.
pub DeletionQueueDepth: u32 = ((DeletionWeightLimit::get() / (
<Runtime as pallet_contracts::Config>::WeightInfo::on_initialize_per_queue_item(1) -
<Runtime as pallet_contracts::Config>::WeightInfo::on_initialize_per_queue_item(0)
)) / 5) as u32;
}

impl pallet_contracts::Config for Runtime {
Expand All @@ -735,6 +745,8 @@ impl pallet_contracts::Config for Runtime {
type WeightPrice = pallet_transaction_payment::Module<Self>;
type WeightInfo = pallet_contracts::weights::SubstrateWeight<Self>;
type ChainExtension = ();
type DeletionQueueDepth = DeletionQueueDepth;
type DeletionWeightLimit = DeletionWeightLimit;
}

impl pallet_sudo::Config for Runtime {
Expand Down
92 changes: 75 additions & 17 deletions frame/contracts/src/benchmarking/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ use self::{
use frame_benchmarking::{benchmarks, account, whitelisted_caller};
use frame_system::{Module as System, RawOrigin};
use parity_wasm::elements::{Instruction, ValueType, BlockType};
use sp_runtime::traits::{Hash, Bounded};
use sp_runtime::traits::{Hash, Bounded, Zero};
use sp_std::{default::Default, convert::{TryInto}, vec::Vec, vec};
use pallet_contracts_primitives::RentProjection;

Expand Down Expand Up @@ -209,37 +209,52 @@ where
}
}

/// A `Contract` that was evicted after accumulating some storage.
/// A `Contract` that contains some storage items.
///
/// This is used to benchmark contract resurrection.
struct Tombstone<T: Config> {
/// This is used to benchmark contract destruction and resurection. Those operations'
/// weight depend on the amount of storage accumulated.
struct ContractWithStorage<T: Config> {
/// The contract that was evicted.
contract: Contract<T>,
/// The storage the contract held when it was avicted.
storage: Vec<(StorageKey, Vec<u8>)>,
}

impl<T: Config> Tombstone<T>
impl<T: Config> ContractWithStorage<T>
where
T: Config,
T::AccountId: UncheckedFrom<T::Hash> + AsRef<[u8]>,
{
/// Create and evict a new contract with the supplied storage item count and size each.
/// Same as [`Self::with_code`] but with dummy contract code.
fn new(stor_num: u32, stor_size: u32) -> Result<Self, &'static str> {
let contract = Contract::<T>::new(WasmModule::dummy(), vec![], Endow::CollectRent)?;
Self::with_code(WasmModule::dummy(), stor_num, stor_size)
}

/// Create and evict a new contract with the supplied storage item count and size each.
fn with_code(code: WasmModule<T>, stor_num: u32, stor_size: u32) -> Result<Self, &'static str> {
let contract = Contract::<T>::new(code, vec![], Endow::CollectRent)?;
let storage_items = create_storage::<T>(stor_num, stor_size)?;
contract.store(&storage_items)?;
System::<T>::set_block_number(
contract.eviction_at()? + T::SignedClaimHandicap::get() + 5u32.into()
);
Rent::<T>::collect(&contract.account_id);
contract.ensure_tombstone()?;

Ok(Tombstone {
Ok(Self {
contract,
storage: storage_items,
})
}

/// Increase the system block number so that this contract is eligible for eviction.
fn set_block_num_for_eviction(&self) -> Result<(), &'static str> {
System::<T>::set_block_number(
self.contract.eviction_at()? + T::SignedClaimHandicap::get() + 5u32.into()
);
Ok(())
}

/// Evict this contract.
fn evict(&mut self) -> Result<(), &'static str> {
self.set_block_num_for_eviction()?;
Rent::<T>::snitch_contract_should_be_evicted(&self.contract.account_id, Zero::zero())?;
self.contract.ensure_tombstone()
}
}

/// Generate `stor_num` storage items. Each has the size `stor_size`.
Expand Down Expand Up @@ -270,6 +285,30 @@ benchmarks! {
_ {
}

// The base weight without any actual work performed apart from the setup costs.
on_initialize {}: {
Storage::<T>::process_deletion_queue_batch(Weight::max_value())
}

on_initialize_per_trie_key {
let k in 0..1024;
let instance = ContractWithStorage::<T>::new(k, T::MaxValueSize::get())?;
Storage::<T>::queue_trie_for_deletion(&instance.contract.alive_info()?)?;
}: {
Storage::<T>::process_deletion_queue_batch(Weight::max_value())
}

on_initialize_per_queue_item {
let q in 0..1024.min(T::DeletionQueueDepth::get());
for i in 0 .. q {
let instance = Contract::<T>::with_index(i, WasmModule::dummy(), vec![], Endow::Max)?;
Storage::<T>::queue_trie_for_deletion(&instance.alive_info()?)?;
ContractInfoOf::<T>::remove(instance.account_id);
}
}: {
Storage::<T>::process_deletion_queue_batch(Weight::max_value())
}

// This extrinsic is pretty much constant as it is only a simple setter.
update_schedule {
let schedule = Schedule {
Expand Down Expand Up @@ -650,7 +689,8 @@ benchmarks! {
// Restore just moves the trie id from origin to destination and therefore
// does not depend on the size of the destination contract. However, to not
// trigger any edge case we won't use an empty contract as destination.
let tombstone = Tombstone::<T>::new(10, T::MaxValueSize::get())?;
let mut tombstone = ContractWithStorage::<T>::new(10, T::MaxValueSize::get())?;
tombstone.evict()?;

let dest = tombstone.contract.account_id.encode();
let dest_len = dest.len();
Expand Down Expand Up @@ -723,7 +763,8 @@ benchmarks! {

seal_restore_to_per_delta {
let d in 0 .. API_BENCHMARK_BATCHES;
let tombstone = Tombstone::<T>::new(0, 0)?;
let mut tombstone = ContractWithStorage::<T>::new(0, 0)?;
tombstone.evict()?;
let delta = create_storage::<T>(d * API_BENCHMARK_BATCH_SIZE, T::MaxValueSize::get())?;

let dest = tombstone.contract.account_id.encode();
Expand Down Expand Up @@ -2368,7 +2409,20 @@ benchmarks! {
#[extra]
print_schedule {
#[cfg(feature = "std")]
println!("{:#?}", Schedule::<T>::default());
{
let weight_per_key = T::WeightInfo::on_initialize_per_trie_key(1) -
T::WeightInfo::on_initialize_per_trie_key(0);
let weight_per_queue_item = T::WeightInfo::on_initialize_per_queue_item(1) -
T::WeightInfo::on_initialize_per_queue_item(0);
let weight_limit = T::DeletionWeightLimit::get();
let queue_depth: u64 = T::DeletionQueueDepth::get().into();
println!("{:#?}", Schedule::<T>::default());
println!("###############################################");
println!("Lazy deletion throughput per block (empty queue, full queue): {}, {}",
weight_limit / weight_per_key,
(weight_limit - weight_per_queue_item * queue_depth) / weight_per_key,
);
}
#[cfg(not(feature = "std"))]
return Err("Run this bench with a native runtime in order to see the schedule.");
}: {}
Expand All @@ -2394,6 +2448,10 @@ mod tests {
}
}

create_test!(on_initialize);
create_test!(on_initialize_per_trie_key);
create_test!(on_initialize_per_queue_item);

create_test!(update_schedule);
create_test!(put_code);
create_test!(instantiate);
Expand Down
29 changes: 16 additions & 13 deletions frame/contracts/src/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,12 +268,12 @@ where
Err(Error::<T>::MaxCallDepthReached)?
}

// Assumption: `collect` doesn't collide with overlay because
// `collect` will be done on first call and destination contract and balance
// cannot be changed before the first call
// We do not allow 'calling' plain accounts. For transfering value
// `seal_transfer` must be used.
let contract = if let Some(ContractInfo::Alive(info)) = Rent::<T>::collect(&dest) {
// This charges the rent and denies access to a contract that is in need of
// eviction by returning `None`. We cannot evict eagerly here because those
// changes would be rolled back in case this contract is called by another
// contract.
// See: https://github.com/paritytech/substrate/issues/6439#issuecomment-648754324
let contract = if let Ok(Some(ContractInfo::Alive(info))) = Rent::<T>::charge(&dest) {
info
} else {
Err(Error::<T>::NotCallable)?
Expand Down Expand Up @@ -575,13 +575,16 @@ where
value,
self.ctx,
)?;
let self_trie_id = self.ctx.self_trie_id.as_ref().expect(
"this function is only invoked by in the context of a contract;\
a contract has a trie id;\
this can't be None; qed",
);
Storage::<T>::destroy_contract(&self_id, self_trie_id);
Ok(())
if let Some(ContractInfo::Alive(info)) = ContractInfoOf::<T>::take(&self_id) {
Storage::<T>::queue_trie_for_deletion(&info)?;
Ok(())
} else {
panic!(
"this function is only invoked by in the context of a contract;\
this contract is therefore alive;\
qed"
);
}
}

fn call(
Expand Down
56 changes: 50 additions & 6 deletions frame/contracts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ use frame_support::{
dispatch::{DispatchResult, DispatchResultWithPostInfo},
traits::{OnUnbalanced, Currency, Get, Time, Randomness},
};
use frame_system::{ensure_signed, ensure_root};
use frame_system::{ensure_signed, ensure_root, Module as System};
use pallet_contracts_primitives::{
RentProjectionResult, GetStorageResult, ContractAccessError, ContractExecResult, ExecResult,
};
Expand Down Expand Up @@ -325,6 +325,12 @@ pub trait Config: frame_system::Config {

/// Type that allows the runtime authors to add new host functions for a contract to call.
type ChainExtension: chain_extension::ChainExtension;

/// The maximum number of tries that can be queued for deletion.
type DeletionQueueDepth: Get<u32>;

/// The maximum amount of weight that can be consumed per block for lazy trie removal.
type DeletionWeightLimit: Get<Weight>;
}

decl_error! {
Expand Down Expand Up @@ -396,6 +402,17 @@ decl_error! {
/// in this error. Note that this usually shouldn't happen as deploying such contracts
/// is rejected.
NoChainExtension,
/// Removal of a contract failed because the deletion queue is full.
///
/// This can happen when either calling [`Module::claim_surcharge`] or `seal_terminate`.
/// The queue is filled by deleting contracts and emptied by a fixed amount each block.
/// Trying again during another block is the only way to resolve this issue.
DeletionQueueFull,
/// A contract could not be evicted because it has enough balance to pay rent.
///
/// This can be returned from [`Module::claim_surcharge`] because the target
/// contract has enough balance to pay for its rent.
ContractNotEvictable,
}
}

Expand Down Expand Up @@ -449,8 +466,24 @@ decl_module! {
/// The maximum size of a storage value in bytes. A reasonable default is 16 KiB.
const MaxValueSize: u32 = T::MaxValueSize::get();

/// The maximum number of tries that can be queued for deletion.
const DeletionQueueDepth: u32 = T::DeletionQueueDepth::get();

/// The maximum amount of weight that can be consumed per block for lazy trie removal.
const DeletionWeightLimit: Weight = T::DeletionWeightLimit::get();

fn deposit_event() = default;

fn on_initialize() -> Weight {
// We do not want to go above the block limit and rather avoid lazy deletion
// in that case. This should only happen on runtime upgrades.
let weight_limit = T::BlockWeights::get().max_block
.saturating_sub(System::<T>::block_weight().total())
.min(T::DeletionWeightLimit::get());
Storage::<T>::process_deletion_queue_batch(weight_limit)
.saturating_add(T::WeightInfo::on_initialize())
}

/// Updates the schedule for metering contracts.
///
/// The schedule must have a greater version than the stored schedule.
Expand Down Expand Up @@ -549,10 +582,14 @@ decl_module! {
/// Allows block producers to claim a small reward for evicting a contract. If a block producer
/// fails to do so, a regular users will be allowed to claim the reward.
///
/// If contract is not evicted as a result of this call, no actions are taken and
/// the sender is not eligible for the reward.
/// If contract is not evicted as a result of this call, [`Error::ContractNotEvictable`]
/// is returned and the sender is not eligible for the reward.
#[weight = T::WeightInfo::claim_surcharge()]
fn claim_surcharge(origin, dest: T::AccountId, aux_sender: Option<T::AccountId>) {
pub fn claim_surcharge(
origin,
dest: T::AccountId,
aux_sender: Option<T::AccountId>
) -> DispatchResult {
let origin = origin.into();
let (signed, rewarded) = match (origin, aux_sender) {
(Ok(frame_system::RawOrigin::Signed(account)), None) => {
Expand All @@ -574,8 +611,10 @@ decl_module! {
};

// If poking the contract has lead to eviction of the contract, give out the rewards.
if Rent::<T>::snitch_contract_should_be_evicted(&dest, handicap) {
T::Currency::deposit_into_existing(&rewarded, T::SurchargeReward::get())?;
if Rent::<T>::snitch_contract_should_be_evicted(&dest, handicap)? {
T::Currency::deposit_into_existing(&rewarded, T::SurchargeReward::get()).map(|_| ())
} else {
Err(Error::<T>::ContractNotEvictable.into())
}
}
}
Expand Down Expand Up @@ -733,6 +772,11 @@ decl_storage! {
///
/// TWOX-NOTE: SAFE since `AccountId` is a secure hash.
pub ContractInfoOf: map hasher(twox_64_concat) T::AccountId => Option<ContractInfo<T>>;
/// Evicted contracts that await child trie deletion.
///
/// Child trie deletion is a heavy operation depending on the amount of storage items
/// stored in said trie. Therefore this operation is performed lazily in `on_initialize`.
pub DeletionQueue: Vec<storage::DeletedContract>;
}
}

Expand Down
Loading