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

Mangata dev v0.9.40 #90

Merged
merged 535 commits into from
May 25, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
535 commits
Select commit Hold shift + click to select a range
cbc525f
Use the balance trait as we have one (#13136)
gilescope Jan 13, 2023
30641ee
CI: Code mark to request a pipeline failure (#13139)
rcny Jan 13, 2023
49962f7
Annotate thiserror for sp_core::crypto::SecretStringError (#13144)
jasl Jan 15, 2023
70f2e36
pallet-offences-benchmarking: Box events in verify (#13151)
bkchr Jan 16, 2023
ea00240
More improvements for the crate publishing pipeline (#13153)
joao-paulo-parity Jan 16, 2023
7ff6fa2
txpool: don't maintain the pool during major sync (#13004)
michalkucharczyk Jan 16, 2023
2893730
[client/network] Add support for `/wss` addresses (#13152)
melekes Jan 17, 2023
6bac243
NIS should retain funds in reserve (#12928)
gavofyork Jan 17, 2023
414caff
Refactory of `next_slot` method (#13155)
davxy Jan 17, 2023
f7e53fe
Breakout mock runtimes to separate files (#13150)
gilescope Jan 17, 2023
42f38db
frame-benchmarking: Macros should not force a particular env (#13161)
bkchr Jan 17, 2023
cfe9262
Fix the `storage_size`/`state_getStorageSize` RPC call (#13154)
koute Jan 18, 2023
a447f03
[contracts] Adapt storage reading host functions to Weights V2 (#12976)
agryaznov Jan 18, 2023
af5a499
zobmienet tests are not supposed to fail (#13015)
michalkucharczyk Jan 18, 2023
cba5977
[contracts] Add integrity checks by pallet hook (#12993)
agryaznov Jan 18, 2023
911c9ab
Expose `UnknownBlock` error via `ApiError` (#12707)
tdimitrov Jan 19, 2023
d4384f2
Notification-based block pinning (#13157)
skunert Jan 19, 2023
0b6aec5
Make DispatchError impl MEL (#13169)
gavofyork Jan 19, 2023
b85d631
Remove fixtures from crate (#13181)
athei Jan 19, 2023
d7acf9e
txpool: LOG_TARGET const added (#13180)
michalkucharczyk Jan 19, 2023
de943ee
Fix potential huge allocation as a result of `validate_block` output …
mrcnski Jan 20, 2023
593c76b
sc-network: Ensure private addresses are disabled if requested (#13185)
bkchr Jan 20, 2023
38ec2d8
Warn validators with slow hardware (#12620)
Szegoo Jan 20, 2023
2c16842
Use year 2023 in the License headers (#13193)
ggwpez Jan 20, 2023
355e4a9
Move slow hardware warning print logic to CLI (#13198)
ggwpez Jan 21, 2023
79cb2e6
Fix flaky BABE test (#13199)
bkchr Jan 21, 2023
1f70226
Add debug info in assert_has_event and assert_last_event (#12979)
zjb0807 Jan 22, 2023
ed3f055
new proc-macro-based benchmarking syntax (#12924)
sam0x17 Jan 23, 2023
d0a2c4a
Rename `*-private-ipv4` to `*-private-ip` CLI args (#13208)
bkchr Jan 23, 2023
e72f72f
Remove dead code (#13213)
koute Jan 23, 2023
419b840
[Fix] CountedMap::set now takes Counter into account (#13214)
ruseinov Jan 23, 2023
52d72b3
debug assert events at genesis (#13217)
muharem Jan 23, 2023
9052607
BlockId removal: refactor: CallExecutor trait (#13173)
michalkucharczyk Jan 24, 2023
ca5a505
service: storage monitor added (#13082)
michalkucharczyk Jan 24, 2023
84af672
beefy: Add LOG_TARGET constant (#13222)
al3mart Jan 24, 2023
09de7b4
Upgrade wasm-opt to 0.111.0 (#13038)
brson Jan 24, 2023
5749760
storage-monitor: statvfs arithmetic bug fixed (#13234)
michalkucharczyk Jan 24, 2023
d2afb5d
Bump parity-db (#13226)
arkpar Jan 24, 2023
1314eec
pallet-assets: Rename `total_supply` to `amount` (#13229)
bkchr Jan 25, 2023
e393874
Babe: bad epoch index with skipped epochs and warp sync (#13135)
davxy Jan 25, 2023
1a1600b
contracts: Deprecate random interface (#13204)
athei Jan 25, 2023
d74eab8
[contracts] Add upfront weight of merkle trie proofs for storage read…
agryaznov Jan 25, 2023
d22e68c
CI: Rewrite `check-each-crate` in python (#13238)
bkchr Jan 25, 2023
d029225
Fix try-runtime with create-snapshot (#13223)
zjb0807 Jan 25, 2023
8b4331c
reduce exec time of fast-unstake benchmarks (#13120)
kianenigma Jan 25, 2023
9db957c
Rework the trie cache (#12982)
koute Jan 26, 2023
64a1a36
Add task type label to metrics (#13240)
sandreim Jan 26, 2023
f4bc993
upgrade nix to 0.26.1 (#13230)
michalkucharczyk Jan 26, 2023
2dbf625
Add WeightToFee and LengthToFee impls to transaction-payment Runtime …
notlesh Jan 26, 2023
495cc0e
Correct arithmetical semantic of `PerDispatchClass` (#13194)
ggwpez Jan 26, 2023
65d1d03
Aura: Fix warp syncing (#13221)
bkchr Jan 26, 2023
ff9921a
Add Proof Size to Weight Output (#11637)
shawntabrizi Jan 26, 2023
248fdf0
Use non-binary pronouns in comments. (#13209)
DanHenton Jan 27, 2023
ce2cee3
migrate new benchmarking syntax from `frame_support::benchmarking` to…
sam0x17 Jan 27, 2023
9762613
mutate_exists for StorageValue with ValueQuery (#13245)
muraca Jan 27, 2023
1e6b892
Fix derive PassByInner with generics (#13247)
conr2d Jan 28, 2023
ece32a7
docs: Fix broken documentation links for pallets (#13241)
Jonathas-Conceicao Jan 28, 2023
0100b3b
sc-finality-grandpa: Warp proof generation can not expect justificati…
bkchr Jan 28, 2023
6c11190
update criterion to v0.4.0 (#13142)
koushiro Jan 28, 2023
f4caddb
fix up template (#13205)
shawntabrizi Jan 29, 2023
fdff2b2
Remove `uncles` related code (#13216)
bkchr Jan 29, 2023
a9c4334
Implement RIType traits for u8 array with an arbitrary size (#13256)
conr2d Jan 30, 2023
129fee7
grandpa: cleanup stale entries in set id session mapping (#13237)
andresilva Jan 30, 2023
8cfe326
Benchmark's successful origin api update (#13146)
muharem Feb 1, 2023
c4b2db5
hooks default impl missing where clause (#13264)
kianenigma Feb 1, 2023
b2b2e65
implemented `contains_prefix` for StorageDoubleMap and StorageNMap (#…
muraca Feb 1, 2023
3bc3742
Calling proxy doesn't remove announcement (#13267)
Szegoo Feb 1, 2023
68d00e2
Fee and tip represented as asset ID inside `AssetTxFeePaid` (#13083)
Szegoo Feb 2, 2023
5d0867c
Move beefy-merkle-tree to utils/binary-merkle-tree and make it generi…
DaviRain-Su Feb 2, 2023
a69a08e
Metadata V15: Derive `TypeInfo` for describing runtime types (#13272)
lexnv Feb 2, 2023
9c00c90
benchmarks: EnsureRankedMember must add ranked members (#13297)
ggwpez Feb 2, 2023
83de509
Minor: Update output validity tests (#13190)
mrcnski Feb 2, 2023
1d67b0f
BEEFY: define on-chain beefy-genesis and use it to coordinate voter i…
acatangiu Feb 3, 2023
12823c2
feat: add event SkepticsChosen event in society (#13291)
gitofdeepanshu Feb 3, 2023
09ae0e0
feat(client): significantly increase wasm instance limits (#13298)
hussein-aitlahcen Feb 3, 2023
8186c51
Remove in-tree bounded types and use bounded-collections crate (#13243)
KiChjang Feb 3, 2023
dfc9223
update linregress in frame-benchmarking to 0.5.1 (#13310)
sam0x17 Feb 5, 2023
550e6a1
[client/network] remove peer entry from `ephemeral_addresses` (#13084)
melekes Feb 6, 2023
f5e370d
rpc-spec-v2/tx: Fix error typo (#13307)
lexnv Feb 6, 2023
51cf2e7
BEEFY: client support for detecting equivocated votes (#13285)
acatangiu Feb 6, 2023
47ecdb6
Bump `wasmtime` to 5.0.0 (and a few other deps) (#13160)
koute Feb 6, 2023
fe7f0a9
Fix: Off-chain-worker example (#13300)
cuteolaf Feb 6, 2023
dd4497d
Rename `pallet-random-collective-flip` to Insecure... (#13301)
ggwpez Feb 6, 2023
41ae908
`zombienet`: warp-sync tests for validators (#13078)
michalkucharczyk Feb 7, 2023
3d60070
Disable default features for `strum` (#13326)
koute Feb 7, 2023
38c3e5e
Fix block pruning (#13323)
arkpar Feb 7, 2023
5a281ce
Fix block pruning (#13323)
arkpar Feb 7, 2023
2f16448
Referendum proposal's metadata (#12568)
muharem Feb 8, 2023
2a636e2
Improve test coverage of the `Notifications` protocol (#13033)
altonen Feb 8, 2023
6a504b0
Configurable voting-degree in council elections pallet (#13305)
kianenigma Feb 8, 2023
6f72780
Rework generated API docs (#13178)
athei Feb 8, 2023
0d611e0
pallet-scheduler: Ensure we request a preimage (#13340)
bkchr Feb 9, 2023
2ced413
[Fix] Try-state feature-gated for BagsList (#13296)
ruseinov Feb 9, 2023
21d58f6
bump version of zombienet and update snaps links (#13359)
pepoviola Feb 10, 2023
ccd768f
Fix longest chain finalization target lookup (#13289)
davxy Feb 11, 2023
11bd6cd
SetMembers configurable origin (#13159)
girazoki Feb 12, 2023
5590a4e
grandpa: don't error if best block and finality target are inconsiste…
andresilva Feb 12, 2023
15e218a
grandpa: don't error if best block and finality target are inconsiste…
andresilva Feb 12, 2023
4fadc98
Improve Weight Template and API (#13355)
shawntabrizi Feb 12, 2023
14fba11
[ci] Change label checker (#13360)
alvicsam Feb 13, 2023
fc49ddd
client/beefy: request justifs from peers further in consensus (#13343)
acatangiu Feb 13, 2023
6142fc2
[ci] Change GHA to add J2 labels instead Z0 (#13375)
alvicsam Feb 13, 2023
10bf4bd
sc-client-db: Fix `PruningMode::ArchiveCanonical` (#13361)
bkchr Feb 13, 2023
18bb7c7
benchmarks: EnsureRankedMember must add ranked members (#13297) (#13348)
muharem Feb 13, 2023
1cc2a00
subkey: only decode hex if requested, CLI `0x` prefixed hex for all `…
ggwpez Feb 13, 2023
a1d42aa
[Feature] Introduce storage_alias for CountedStorageMap (#13366)
ruseinov Feb 13, 2023
0ce3920
[NFTs] Offchain mint (#13158)
jsidorenko Feb 14, 2023
ef1c361
feat: improve FinalityProofProvider api (#13374)
yjhmelody Feb 14, 2023
e6f6c8c
cleanup `<weight></weight>` from docs comments (#13350)
vivekvpandya Feb 14, 2023
3ca3f77
zombienet: is up timtout increased to 30s (#13386)
michalkucharczyk Feb 14, 2023
c3ffbcd
pallet-timestamp: Remove `ValidAtTimestamp` error variant (#13346)
bkchr Feb 14, 2023
74ee521
add warp to target block for parachains (#12761)
samelamin Feb 14, 2023
169c3f0
[contracts] make `debug_message` execution outcome invariant to node …
agryaznov Feb 14, 2023
a10ccb5
Fork tree prune assumptions removal v2 (#13327)
davxy Feb 15, 2023
725e47a
CI add subkey docker image description and CI job to publish it to th…
sergejparity Feb 15, 2023
7732f88
contracts: Use `proof_size` from benchmarks (#13268)
athei Feb 15, 2023
528e71f
[ci] Move publish-crates-locally to publish stage (#13395)
alvicsam Feb 16, 2023
c24969a
[ci] Add dependencies for publish-crates (#13397)
alvicsam Feb 16, 2023
6a36704
fix image name (#13398)
sergejparity Feb 16, 2023
46c1bd5
client/beefy: add more metrics for production visibility (#12910)
dharjeezy Feb 16, 2023
e8178c9
contracts: Don't rely on reserved balances keeping an account alive (…
athei Feb 16, 2023
b6c4ab8
fix docker description publishing (#13399)
sergejparity Feb 16, 2023
873fb68
`BlockId` removal: `CallApiAt::state_at` (#13394)
michalkucharczyk Feb 16, 2023
d97a188
`BlockId` removal: `Client::runtime_version_at` (#13393)
michalkucharczyk Feb 16, 2023
63a2458
BEEFY: implement equivocations detection, reporting and slashing (#13…
acatangiu Feb 17, 2023
dfa654d
network: Detect early that `NotificationOutSubstream` was closed by t…
dmitry-markin Feb 17, 2023
ea4fbcb
babe: account for skipped epochs when handling equivocations (#13335)
andresilva Feb 17, 2023
a330912
`try-runtime::fast-forward` (#12896)
pmikolajczyk41 Feb 17, 2023
30cb4d1
Revert "network: Detect early that `NotificationOutSubstream` was clo…
dmitry-markin Feb 17, 2023
7ffae37
state-db: Print warning when using large pruning window on RocksDb (#…
bkchr Feb 18, 2023
76208c8
Use async/await instead of manual polling of `NetworkWorker` (#13219)
dmitry-markin Feb 20, 2023
abfa341
client/beefy: drop justification on import if pallet not enabled (#13…
acatangiu Feb 20, 2023
1eff887
rename call_runtime() returned error (#13412)
agryaznov Feb 20, 2023
5b6519a
`BlockId` removal: `runtime-api` refactor (#13255)
michalkucharczyk Feb 20, 2023
49fa611
frame/beefy: prune entries in set id session mapping (#13411)
acatangiu Feb 21, 2023
425bf6b
Staking and nomination pools runtime API improvements (#13119)
gpestana Feb 21, 2023
088a7fc
Nomination Pools: Rename state-toggler to bouncer (#13421)
Feb 21, 2023
0e8daf0
Add `defensive_assert!` macro (#13423)
ggwpez Feb 21, 2023
2d6e555
`BlockId` removal: `BlockBuilderProvider::new_block_at` (#13401)
michalkucharczyk Feb 21, 2023
e374a33
Remove years from copyright notes. (#13415)
vivekvpandya Feb 21, 2023
59fd2ac
Update Template README (#12741)
nuke-web3 Feb 21, 2023
ea18266
Glutton pallet (#12833)
Szegoo Feb 21, 2023
b77175d
Introduce EnsureOrigin to democracy.propose (#13410)
mrshiposha Feb 21, 2023
86c6bb9
Rework storage iterators (#13284)
koute Feb 22, 2023
473b5d0
permissionless `bond_extra` in nomination pools (#12608)
Doordashcon Feb 22, 2023
b0ed48e
[NFTs] Update attributes with offchain signature (#13390)
jsidorenko Feb 22, 2023
56de870
generation of real benchmark functions for benchmarking v2 (#13224)
sam0x17 Feb 22, 2023
5a1d521
Bump `wasmtime` to 6.0.0 (#13429)
koute Feb 23, 2023
4be5dd2
Abstracts elections-phragmen pallet to use NposSolver (#12588)
gpestana Feb 23, 2023
919d5cf
Move rules into common place (#13428)
sergejparity Feb 23, 2023
91b4739
Nfts attribute read interface (#13349)
mrshiposha Feb 23, 2023
fbddfbd
Revert "Abstracts elections-phragmen pallet to use NposSolver (#12588…
gpestana Feb 23, 2023
1837f42
wasm-executor: Support growing the memory (#12520)
bkchr Feb 24, 2023
37e3abd
Automatically format ci pipeline specs with prettier (#13441)
Feb 24, 2023
9526f04
Yieldable queues for pallet `MessageQueue` (#13424)
ggwpez Feb 25, 2023
3d8a025
Support the subscription of every imported block (#13372)
liuchengxu Feb 27, 2023
4ad96cf
[client/network] Remove unused argument (#13444)
melekes Feb 27, 2023
7d76719
Further storage iterator refactoring (#13445)
koute Feb 27, 2023
7c8b89b
Move grandpa crates to consensus folder (#13458)
davxy Feb 27, 2023
1cbb2ef
constructor for MemberRecord (#13473)
muharem Feb 27, 2023
2957120
`pallet-treasury`: Ensure we respect `max_amount` for spend across ba…
bkchr Feb 27, 2023
3d40b17
Add Windows support for storage monitor (#13466)
ark0f Feb 27, 2023
0d36e75
Service::Error: Storage variant removed (#13481)
michalkucharczyk Feb 27, 2023
f2615a4
Adjust the ratio of the `in-peers`/`out-peers` (#13477)
altonen Feb 28, 2023
2a7887e
Fix V2 PoV benchmarking (#13485)
ggwpez Feb 28, 2023
b7e0518
Move BEEFY code to consensus (#13484)
davxy Feb 28, 2023
ad53996
chore: move genesis block builder to chain-spec crate. (#13427)
yjhmelody Feb 28, 2023
aa31d1b
Speed up storage iteration from within the runtime (#13479)
koute Mar 1, 2023
5cd4847
Make unbounded channels size warning exact (part 1) (#13490)
dmitry-markin Mar 1, 2023
8ae4738
Removal of Prometheus alerting rules deployment in cloud-infra (#13499)
lazam Mar 1, 2023
3986560
sp-consensus: remove unused error variants (#13495)
andresilva Mar 1, 2023
376ada8
Expose `ChargedAmount` (#13488)
pmikolajczyk41 Mar 1, 2023
024bfce
sc-consensus-beefy: fix metrics: use correct names (#13494)
acatangiu Mar 1, 2023
4aa213c
Assets pallet: Giving the asset owner the ability to set minimum bala…
Szegoo Mar 2, 2023
7d00033
network-gossip: Do not report peer on duplicate message if its the fi…
bkchr Mar 2, 2023
df93a0d
im-online: don't disable offending validators (#13493)
andresilva Mar 2, 2023
d1d67cd
Return account's asset balances (#13352)
jsidorenko Mar 2, 2023
6e81199
Deprecate `Weight::from_{ref_time, proof_size}` (#13475)
ggwpez Mar 2, 2023
6f923ee
bump API versions of {Beefy,Mmr}Api (#13509)
Lederstrumpf Mar 3, 2023
e8f5bc1
[NFTs] Emit new PalletAttributeSet event (#13525)
jsidorenko Mar 3, 2023
96a6cd3
fix feature/enhancement issue template (#13522)
Mar 3, 2023
2cb4825
Bump parity-db (#13521)
arkpar Mar 3, 2023
48c9de8
Salary pallet (#13378)
gavofyork Mar 3, 2023
e923511
Assets pallet: Don't allow `set_min_balance` when sufficient (#13510)
Szegoo Mar 3, 2023
2520ded
bump `zombienet` version to v1.3.37 (#13447)
pepoviola Mar 3, 2023
c2034a8
Just a typo (#13533)
gavofyork Mar 4, 2023
f57ff37
FRAME: add a basic readme (#13520)
Mar 4, 2023
7d8aa66
Update staking related code-owners (#13462)
kianenigma Mar 5, 2023
1d9a139
[contracts] Forbid calling back to contracts after switching to runti…
agryaznov Mar 6, 2023
435446f
chore: reduce copy times for bytes in core-hashing (#13519)
yjhmelody Mar 6, 2023
c408123
[CI] Remove redundant trigger-review-pipeline job (#13547)
s3krit Mar 6, 2023
e7aa37e
Extract syncing protocol from `sc-network` (#12828)
altonen Mar 6, 2023
0f5a22a
Expose `new_full_parts_with_genesis_builder` from sc-service (#13539)
liuchengxu Mar 6, 2023
2aa2b4e
Make unbounded channels size warning exact (part 2) (#13504)
dmitry-markin Mar 7, 2023
6a15476
Switch to the `blake2b_simd` crate in `sp-core-hashing` (#13548)
koute Mar 7, 2023
c09ce08
remove serde derive for BlockId (#13457)
yjhmelody Mar 7, 2023
4d8f3d5
rpc/chainHead: Fix pruned blocks events from forks (#13379)
lexnv Mar 7, 2023
d90e41a
core: remove unused localized signature type (#13552)
andresilva Mar 7, 2023
cab4851
resolve conflicts for 38 version
devdanco Mar 7, 2023
8d0b756
Pub enum runtime to pub struct runtime (#13250)
a-moreira Mar 7, 2023
8a4746e
consensus: remove caching functionality from block import pipeline (#…
andresilva Mar 7, 2023
306382b
`MessageQueue`: unknit permanently overweight books (#13528)
ggwpez Mar 7, 2023
851e73a
Offences report system rework (#13425)
davxy Mar 7, 2023
f59f501
fix: Fixes #13071 change order of ldd command and update ./docker/REA…
ltfschoen Mar 7, 2023
7c3d279
[docker] Use `BASH_SOURCE` to find project root, add `.dockerignore` …
ltfschoen Mar 8, 2023
77c675b
Update Docker instructions (#13437)
ltfschoen Mar 8, 2023
48e7cb1
Bump wasmtime from 6.0.0 to 6.0.1 (#13566)
dependabot[bot] Mar 9, 2023
e46d96c
Undeploy insecure randomness pallet (#13560)
ggwpez Mar 9, 2023
11b9326
grandpa: send neighbor packets to light clients on set transition (#1…
andresilva Mar 9, 2023
48c8875
Make pallet_nfts storages public (#13517)
jasl Mar 9, 2023
33eee69
Add amalgamation traits for NFT CollectionId and ItemId (#13514)
jasl Mar 9, 2023
0f3b2a2
Nfts: Make ItemConfig members pub (#13575)
jasl Mar 10, 2023
8f9b074
Nfts: minor fixes (#13576)
jsidorenko Mar 10, 2023
9d34fb0
Logic for the (Core) Fellowship (#13503)
gavofyork Mar 11, 2023
3c3b223
Fix dependabot labels (#13578)
Mar 11, 2023
310fe40
BEEFY: introduce offence report system (#13564)
davxy Mar 11, 2023
f5c2cec
[NFTs] Rework permissions model (#13482)
jsidorenko Mar 13, 2023
1bbde5d
Remove use of trait Store from all pallets and deprecate it. (#13535)
vivekvpandya Mar 13, 2023
30aa444
Pallet assets improvements (#13543)
Dinonard Mar 13, 2023
959c5b6
Metadata V15: Expose pallet documentation (#13452)
lexnv Mar 13, 2023
3a94009
sc-slots: Cleanup (#13590)
bkchr Mar 13, 2023
4f28d29
[NFTs] Allow to set the role to None (#13591)
jsidorenko Mar 14, 2023
897b95d
Move code from `sc-network-common` back to `sc-network` (#13592)
altonen Mar 14, 2023
39510ec
sc-consensus-beefy: fix on-demand async state machine (#13599)
acatangiu Mar 14, 2023
03ea99e
update trie deps (#13601)
cheme Mar 14, 2023
9eafc96
sp-api: Support expanding the macro code (#13573)
bkchr Mar 14, 2023
e44038a
frame epm: expose `feasibility_check` in MinerConfig (#13555)
niklasad1 Mar 14, 2023
ae83a67
Nomination Pool Commission (#13128)
Mar 15, 2023
d3fd543
Pallet dispatchable+storage doc module. (#13341)
kianenigma Mar 15, 2023
ba87188
timestamp gitlab ci job outputs (#13605)
Mar 15, 2023
76fed9b
Reward pool migration fix (#13715)
Mar 27, 2023
63ab2b9
Merge branch 'mangata-dev' into mangata-dev-v0.9.38
devdanco Mar 28, 2023
baab590
resolve confclits for version 40
devdanco Mar 29, 2023
3218566
Merge branch 'mangata-dev' into mangata-dev-v0.9.40
devdanco Apr 13, 2023
fb082d3
replace from_ref_time to from_parts
devdanco Apr 13, 2023
05ddb88
update to best hash
devdanco Apr 21, 2023
d28e97f
remove reference
devdanco Apr 21, 2023
df06b64
Merge branch 'mangata-dev' into mangata-dev-v0.9.40
devdanco May 3, 2023
f555f67
update reference
devdanco May 9, 2023
5863da1
fix fmt
devdanco May 11, 2023
5254e08
wip: unwrap header metadata
devdanco May 15, 2023
798eaf7
add info logger
devdanco May 15, 2023
f1372ef
wip info debug
devdanco May 15, 2023
c092254
wip
devdanco May 15, 2023
5f519d5
wip
devdanco May 15, 2023
f12ca2b
wip
devdanco May 16, 2023
17d2768
wip
devdanco May 16, 2023
95f54d8
fix bench for overhead
vanderian May 17, 2023
135093a
fix header metadata
devdanco May 18, 2023
89fd020
remove comments
devdanco May 22, 2023
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] Add integrity checks by pallet hook (paritytech#12993)
* integrity test for MaxCodeLen and CallStack::len()

* integrity test for MaxDebugBufferLen

* addressed review comments

* fix append_debug_buffer()

* ci fix

* updated code_len_limit formula after further discussion

* enlarged mem safe margin after discussion

* +doc to Config trait associated types

* Apply suggestions from code review

Co-authored-by: Alexander Theißen <[email protected]>

* more lil fixes from code review feedback

* lowered max call depth to satisfy mem limits

* fix node runtime pallet params to satisfy integrity check

* fix max call depth value calc

Co-authored-by: Alexander Theißen <[email protected]>
  • Loading branch information
agryaznov and athei authored Jan 18, 2023
commit cba59778aa5207b11f7513e5cbb127ea47dd8924
4 changes: 2 additions & 2 deletions bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1206,15 +1206,15 @@ impl pallet_contracts::Config for Runtime {
type CallFilter = Nothing;
type DepositPerItem = DepositPerItem;
type DepositPerByte = DepositPerByte;
type CallStack = [pallet_contracts::Frame<Self>; 31];
type CallStack = [pallet_contracts::Frame<Self>; 5];
type WeightPrice = pallet_transaction_payment::Pallet<Self>;
type WeightInfo = pallet_contracts::weights::SubstrateWeight<Self>;
type ChainExtension = ();
type DeletionQueueDepth = DeletionQueueDepth;
type DeletionWeightLimit = DeletionWeightLimit;
type Schedule = Schedule;
type AddressGenerator = pallet_contracts::DefaultAddressGenerator;
type MaxCodeLen = ConstU32<{ 128 * 1024 }>;
type MaxCodeLen = ConstU32<{ 123 * 1024 }>;
type MaxStorageKeyLen = ConstU32<128>;
type UnsafeUnstableInterface = ConstBool<false>;
type MaxDebugBufferLen = ConstU32<{ 2 * 1024 * 1024 }>;
Expand Down
24 changes: 13 additions & 11 deletions frame/contracts/src/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1336,7 +1336,18 @@ where

fn append_debug_buffer(&mut self, msg: &str) -> bool {
if let Some(buffer) = &mut self.debug_message {
let mut msg = msg.bytes();
let err_msg = scale_info::prelude::format!(
"Debug message too big (size={}) for debug buffer (bound={})",
msg.len(),
DebugBufferVec::<T>::bound(),
);

let mut msg = if msg.len() > DebugBufferVec::<T>::bound() {
err_msg.bytes()
} else {
msg.bytes()
};

let num_drain = {
let capacity = DebugBufferVec::<T>::bound().checked_sub(buffer.len()).expect(
"
Expand All @@ -1349,16 +1360,7 @@ where
msg.len().saturating_sub(capacity).min(buffer.len())
};
buffer.drain(0..num_drain);
buffer
.try_extend(&mut msg)
.map_err(|_| {
log::debug!(
target: "runtime::contracts",
"Debug message to big (size={}) for debug buffer (bound={})",
msg.len(), DebugBufferVec::<T>::bound(),
);
})
.ok();
buffer.try_extend(&mut msg).ok();
true
} else {
false
Expand Down
75 changes: 74 additions & 1 deletion frame/contracts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ use pallet_contracts_primitives::{
StorageDeposit,
};
use scale_info::TypeInfo;
use smallvec::Array;
use sp_runtime::traits::{Convert, Hash, Saturating, StaticLookup, TrailingZeroInput};
use sp_std::{fmt::Debug, marker::PhantomData, prelude::*};

Expand Down Expand Up @@ -272,7 +273,10 @@ pub mod pallet {
/// The allowed depth is `CallStack::size() + 1`.
/// Therefore a size of `0` means that a contract cannot use call or instantiate.
/// In other words only the origin called "root contract" is allowed to execute then.
type CallStack: smallvec::Array<Item = Frame<Self>>;
///
/// This setting along with [`MaxCodeLen`](#associatedtype.MaxCodeLen) directly affects
/// memory usage of your runtime.
type CallStack: Array<Item = Frame<Self>>;

/// The maximum number of contracts that can be pending for deletion.
///
Expand Down Expand Up @@ -323,6 +327,10 @@ pub mod pallet {
/// The maximum length of a contract code in bytes. This limit applies to the instrumented
/// version of the code. Therefore `instantiate_with_code` can fail even when supplying
/// a wasm binary below this maximum size.
///
/// The value should be chosen carefully taking into the account the overall memory limit
/// your runtime has, as well as the [maximum allowed callstack
/// depth](#associatedtype.CallStack). Look into the `integrity_test()` for some insights.
#[pallet::constant]
type MaxCodeLen: Get<u32>;

Expand Down Expand Up @@ -372,6 +380,71 @@ pub mod pallet {
T::WeightInfo::on_process_deletion_queue_batch()
}
}

fn integrity_test() {
// Total runtime memory is expected to have 128Mb upper limit
const MAX_RUNTIME_MEM: u32 = 1024 * 1024 * 128;
// Memory limits for a single contract:
// Value stack size: 1Mb per contract, default defined in wasmi
const MAX_STACK_SIZE: u32 = 1024 * 1024;
// Heap limit is normally 16 mempages of 64kb each = 1Mb per contract
let max_heap_size = T::Schedule::get().limits.max_memory_size();
// Max call depth is CallStack::size() + 1
let max_call_depth = u32::try_from(T::CallStack::size().saturating_add(1))
.expect("CallStack size is too big");

// Check that given configured `MaxCodeLen`, runtime heap memory limit can't be broken.
//
// In worst case, the decoded wasm contract code would be `x16` times larger than the
// encoded one. This is because even a single-byte wasm instruction has 16-byte size in
// wasmi. This gives us `MaxCodeLen*16` safety margin.
//
// Next, the pallet keeps both the original and instrumented wasm blobs for each
// contract, hence we add up `MaxCodeLen*2` more to the safety margin.
//
// Finally, the inefficiencies of the freeing-bump allocator
// being used in the client for the runtime memory allocations, could lead to possible
// memory allocations for contract code grow up to `x4` times in some extreme cases,
// which gives us total multiplier of `18*4` for `MaxCodeLen`.
//
// That being said, for every contract executed in runtime, at least `MaxCodeLen*18*4`
// memory should be available. Note that maximum allowed heap memory and stack size per
// each contract (stack frame) should also be counted.
//
// Finally, we allow 50% of the runtime memory to be utilized by the contracts call
// stack, keeping the rest for other facilities, such as PoV, etc.
//
// This gives us the following formula:
//
// `(MaxCodeLen * 18 * 4 + MAX_STACK_SIZE + max_heap_size) * max_call_depth <
// MAX_RUNTIME_MEM/2`
//
// Hence the upper limit for the `MaxCodeLen` can be defined as follows:
let code_len_limit = MAX_RUNTIME_MEM
.saturating_div(2)
.saturating_div(max_call_depth)
.saturating_sub(max_heap_size)
.saturating_sub(MAX_STACK_SIZE)
.saturating_div(18 * 4);

assert!(
T::MaxCodeLen::get() < code_len_limit,
"Given `CallStack` height {:?}, `MaxCodeLen` should be set less than {:?} \
(current value is {:?}), to avoid possible runtime oom issues.",
max_call_depth,
code_len_limit,
T::MaxCodeLen::get(),
);

// Debug buffer should at least be large enough to accomodate a simple error message
const MIN_DEBUG_BUF_SIZE: u32 = 256;
assert!(
T::MaxDebugBufferLen::get() > MIN_DEBUG_BUF_SIZE,
"Debug buffer should have minimum size of {} (current setting is {})",
MIN_DEBUG_BUF_SIZE,
T::MaxDebugBufferLen::get(),
)
}
}

#[pallet::call]
Expand Down
4 changes: 0 additions & 4 deletions frame/contracts/src/schedule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,6 @@ pub struct Limits {
/// The maximum length of a subject in bytes used for PRNG generation.
pub subject_len: u32,

/// The maximum nesting level of the call stack.
pub call_depth: u32,

/// The maximum size of a storage value and event payload in bytes.
pub payload_len: u32,
}
Expand Down Expand Up @@ -532,7 +529,6 @@ impl Default for Limits {
table_size: 4096,
br_table_size: 256,
subject_len: 32,
call_depth: 32,
payload_len: 16 * 1024,
}
}
Expand Down
4 changes: 2 additions & 2 deletions frame/contracts/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ impl Config for Test {
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
type CallFilter = TestFilter;
type CallStack = [Frame<Self>; 31];
type CallStack = [Frame<Self>; 5];
type WeightPrice = Self;
type WeightInfo = ();
type ChainExtension =
Expand All @@ -405,7 +405,7 @@ impl Config for Test {
type DepositPerByte = DepositPerByte;
type DepositPerItem = DepositPerItem;
type AddressGenerator = DefaultAddressGenerator;
type MaxCodeLen = ConstU32<{ 128 * 1024 }>;
type MaxCodeLen = ConstU32<{ 123 * 1024 }>;
type MaxStorageKeyLen = ConstU32<128>;
type UnsafeUnstableInterface = UnstableInterface;
type MaxDebugBufferLen = ConstU32<{ 2 * 1024 * 1024 }>;
Expand Down