Skip to content

[revive] eth-decimals#9101

Merged
pgherveou merged 66 commits intomasterfrom
pg/eth-decimals
Jul 21, 2025
Merged

[revive] eth-decimals#9101
pgherveou merged 66 commits intomasterfrom
pg/eth-decimals

Conversation

@pgherveou
Copy link
Copy Markdown
Contributor

@pgherveou pgherveou commented Jul 4, 2025

On Ethereum, 1 ETH is represented as 10^18 wei (wei being the smallest unit).
On Polkadot 1 DOT is defined as 1010 plancks. It means that any value smaller than 10^8 wei can not be expressed with the native balance. Any contract that attempts to use such a value currently reverts with a DecimalPrecisionLoss error.

In theory, RPC can define a decimal representation different from Ethereum mainnet (10^18). In practice tools (frontend libraries, wallets, and compilers) ignore it and expect 18 decimals.

The current behaviour breaks eth compatibility and needs to be updated. See issue #109 for more details.

design doc: https://docs.google.com/document/d/1eujRX13Q80x56lySZWlPO5NjVgaLyLetXbcL0Vy58ck/edit?usp=sharing

Fix paritytech/contract-issues#109
weights compare

@pgherveou
Copy link
Copy Markdown
Contributor Author

/cmd bench --runtime dev --pallet pallet-revive

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 5, 2025

Command "bench --runtime dev --pallet pallet-revive" has started 🚀 See logs here

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 5, 2025

Command "bench --runtime dev --pallet pallet-revive" has failed ❌! See logs here

@pgherveou
Copy link
Copy Markdown
Contributor Author

/cmd bench --runtime dev --pallet pallet-revive

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 5, 2025

Command "bench --runtime dev --pallet pallet-revive" has started 🚀 See logs here

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 5, 2025

Command "bench --runtime dev --pallet pallet-revive" has failed ❌! See logs here

@pgherveou
Copy link
Copy Markdown
Contributor Author

/cmd bench --runtime dev --pallet pallet_revive

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 5, 2025

Command "bench --runtime dev --pallet pallet_revive" has started 🚀 See logs here

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 5, 2025

Command "bench --runtime dev --pallet pallet_revive" has finished ✅ See logs here

Details

Subweight results:
File Extrinsic Old New Change [%]
substrate/frame/revive/src/weights.rs seal_balance 4.81us 11.96us +148.39
substrate/frame/revive/src/weights.rs seal_call 266.54us 590.08us +121.38
substrate/frame/revive/src/weights.rs seal_minimum_balance 151.00ns 290.00ns +92.05
substrate/frame/revive/src/weights.rs seal_call_data_load 142.00ns 270.00ns +90.14
substrate/frame/revive/src/weights.rs seal_return_data_size 149.00ns 271.00ns +81.88
substrate/frame/revive/src/weights.rs seal_call_data_size 154.00ns 277.00ns +79.87
substrate/frame/revive/src/weights.rs seal_caller 233.00ns 417.00ns +78.97
substrate/frame/revive/src/weights.rs seal_base_fee 154.00ns 273.00ns +77.27
substrate/frame/revive/src/weights.rs seal_origin 206.00ns 349.00ns +69.42
substrate/frame/revive/src/weights.rs seal_block_number 167.00ns 278.00ns +66.47
substrate/frame/revive/src/weights.rs seal_now 156.00ns 257.00ns +64.74
substrate/frame/revive/src/weights.rs seal_value_transferred 170.00ns 274.00ns +61.18
substrate/frame/revive/src/weights.rs seal_ref_time_left 168.00ns 268.00ns +59.52
substrate/frame/revive/src/weights.rs seal_own_code_hash 176.00ns 270.00ns +53.41
substrate/frame/revive/src/weights.rs seal_gas_price 163.00ns 246.00ns +50.92
substrate/frame/revive/src/weights.rs seal_address 204.00ns 306.00ns +50.00
substrate/frame/revive/src/weights.rs seal_balance_of 59.45us 88.44us +48.76
substrate/frame/revive/src/weights.rs seal_caller_is_origin 228.00ns 335.00ns +46.93
substrate/frame/revive/src/weights.rs seal_caller_is_root 203.00ns 278.00ns +36.95
substrate/frame/revive/src/weights.rs seal_gas_limit 370.00ns 456.00ns +23.24
substrate/frame/revive/src/weights.rs seal_instantiate 1.60ms 1.81ms +13.11
substrate/frame/revive/src/weights.rs noop_host_fn 271.65us 305.35us +12.41
substrate/frame/revive/src/weights.rs set_transient_storage_empty 1.40us 1.57us +12.04
substrate/frame/revive/src/weights.rs get_transient_storage_empty 1.39us 1.52us +9.81
substrate/frame/revive/src/weights.rs get_transient_storage_full 1.53us 1.68us +9.80
substrate/frame/revive/src/weights.rs seal_weight_to_fee 1.48us 1.62us +9.48
substrate/frame/revive/src/weights.rs set_transient_storage_full 1.81us 1.97us +8.72
substrate/frame/revive/src/weights.rs seal_contains_transient_storage 1.80us 1.94us +7.79
substrate/frame/revive/src/weights.rs rollback_transient_storage 1.08us 1.16us +7.39
substrate/frame/revive/src/weights.rs instr 1.30ms 1.39ms +7.09
substrate/frame/revive/src/weights.rs seal_weight_left 637.00ns 681.00ns +6.91
substrate/frame/revive/src/weights.rs seal_get_transient_storage 2.06us 2.16us +5.09
substrate/frame/revive/src/weights.rs call_with_code_per_byte 707.70us 671.44us -5.12
substrate/frame/bags-list/src/weights.rs rebag_terminal 770.63us 728.18us -5.51
substrate/frame/bags-list/src/weights.rs rebag_non_terminal 773.70us 729.72us -5.68
substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_staking_async.rs set_min_commission 108.18us 102.00us -5.71
substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_staking_async.rs set_validator_count 108.52us 102.00us -6.01
substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_staking_async.rs cancel_deferred_slash 138.44ms 129.76ms -6.27
substrate/frame/revive/src/weights.rs instantiate_with_code 4.42ms 4.12ms -6.96
substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_staking_async.rs set_invulnerables 109.83us 102.03us -7.10
substrate/frame/revive/src/weights.rs instantiate 2.12ms 1.90ms -10.46
substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_staking_async.rs deprecate_controller_batch 350.46ms 313.42ms -10.57
substrate/frame/revive/src/weights.rs seal_copy_to_contract 77.67us 68.46us -11.87
substrate/frame/revive/src/weights.rs seal_return 78.04us 68.38us -12.37
substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_staking_async.rs kick 19.28ms 16.83ms -12.75
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_bags_list.rs rebag_terminal 857.28us 735.59us -14.20
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_bags_list.rs rebag_non_terminal 862.27us 737.83us -14.43
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_bags_list.rs put_in_front_of 1.08ms 917.43us -14.68
substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_staking_async.rs set_controller 468.00us 397.00us -15.17
substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_staking_async.rs validate 1.02ms 851.00us -16.97
substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_staking_async.rs force_no_eras 129.42us 107.00us -17.32
substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_staking_async.rs force_new_era_always 129.68us 107.00us -17.49
substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_staking_async.rs force_new_era 130.53us 107.00us -18.03
substrate/frame/revive/src/weights.rs identity 39.27us 31.50us -19.79
substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_staking_async.rs restore_ledger 492.57us 389.00us -21.03
substrate/frame/revive/src/weights.rs seal_call_data_copy 39.18us 30.22us -22.87
substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_staking_async.rs bond 734.02us 554.00us -24.53
substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_staking_async.rs set_payee 224.55us 169.00us -24.74
substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_staking_async.rs update_payee 267.08us 199.00us -25.49
substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_staking_async.rs migrate_currency 561.22us 416.00us -25.88
substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_staking_async.rs withdraw_unbonded_update 638.75us 430.00us -32.68
substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_staking_async.rs rc_on_offence 216.94ms 143.21ms -33.99
substrate/frame/revive/src/weights.rs seal_call_precompile 486.20us 275.73us -43.29
substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_staking_async.rs apply_slash 74.86ms 39.99ms -46.59
substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_staking_async.rs payout_stakers_alive_staked 74.97ms 33.57ms -55.22
substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_staking_async.rs process_offence_queue 46.45ms 8.82ms -81.00
substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_staking_async.rs force_unstake 19.98ms 1.61ms -91.94
substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_staking_async.rs nominate 19.61ms 1.43ms -92.69
substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_staking_async.rs rc_on_session_report 15.90ms 1.12ms -92.97
substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_staking_async.rs chill_other 14.29ms 988.00us -93.08
substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_staking_async.rs reap_stash 22.57ms 1.50ms -93.38
substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_staking_async.rs withdraw_unbonded_kill 24.74ms 1.51ms -93.88
substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_staking_async.rs chill 14.83ms 907.00us -93.88
substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_staking_async.rs rebond 16.20ms 933.43us -94.24
substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_staking_async.rs unbond 18.74ms 1.01ms -94.63
substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_staking_async.rs bond_extra 20.06ms 1.05ms -94.74
substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_staking_async.rs force_apply_min_commission 4.91ms 162.00us -96.70
substrate/frame/revive/src/weights.rs seal_is_contract 34.07us Added
substrate/frame/revive/src/weights.rs eth_instantiate_with_code 2.94ms Added
substrate/frame/revive/src/weights.rs eth_call 772.54us Added
Command output:

✅ Successful benchmarks of runtimes/pallets:
-- dev: ['pallet_revive']


let mut cursor = None;
let mut weight_meter = WeightMeter::new();
while let Some(new_cursor) = Migration::<Test>::step(cursor, &mut weight_meter).unwrap() {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think it should be possible to call pallet_migrations::on_initialize and on_finalize in a loop.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah don't really care here, just want to test out the step logic itself

@pgherveou pgherveou enabled auto-merge July 19, 2025 11:19
@pgherveou pgherveou added this pull request to the merge queue Jul 21, 2025
auto-merge was automatically disabled July 21, 2025 14:02

Pull Request is not mergeable

Merged via the queue into master with commit 7a747ff Jul 21, 2025
276 of 283 checks passed
@pgherveou pgherveou deleted the pg/eth-decimals branch July 21, 2025 14:03
ordian added a commit that referenced this pull request Jul 24, 2025
* master: (67 commits)
  Fix subsume_assets incorrectly merging two AssetsInHolding (#9179)
  Replace `log` with `tracing` on `pallet-bridge-grandpa` (#9294)
  [Staking Async] Saturating accrue era reward points (#9186)
  fix: skip verifying imported blocks (#9280)
  Ci-unified update (with solc and resolc) (#9289)
  Dedup dependencies between dependencies and dev-dependencies (#9233)
  network: Upgrade litep2p to v0.10.0 (#9287)
  consensus/grandpa: Fix high number of peer disconnects with invalid justification (#9015)
  Zombienet CI improvements (#9172)
  Rewrite old disputes test with zombienet-sdk (#9257)
  [revive] eth-decimals (#9101)
  Allow setting idle connection timeout value in custom node implementations (#9251)
  gossip-support: make low connectivity message an error (#9264)
  Rewrite validator disabling test with zombienet-sdk (#9128)
  Fix CandidateDescriptor debug logs (#9255)
  babe: keep stateless verification in `Verifier`, move everything else to the import queue (#9147)
  Allow locking to bump consumer without limits (#9176)
  feat(cumulus): Adds support for additional relay state keys in parachain validation data inherent (#9262)
  zombienet, make logs for para works (#9230)
  Remove `subwasmlib` (#9252)
  ...
EgorPopelyaev added a commit to EgorPopelyaev/polkadot-sdk that referenced this pull request Jul 25, 2025
* Don't use labels for branch names creation in the backport bot (paritytech#9243)

* Remove unused deps (paritytech#9235)

# Description

Remove unused deps using `cargo udeps`

Part of: paritytech#6906

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Branislav Kontur <bkontur@gmail.com>

* Fixed genesis config presets for bridge tests (paritytech#9185)

Closes: paritytech#9116

---------

Co-authored-by: Branislav Kontur <bkontur@gmail.com>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Karol Kokoszka <karol@parity.io>

* Remove `subwasmlib` (paritytech#9252)

This removes `subwasmlib` and replaces it with some custom code to fetch
the metadata. Main point of this change is the removal of some external
dependency.

Closes: paritytech#9203

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* zombienet, make logs for para works (paritytech#9230)

Fix for correctly display the logs (urls) for paras.

* feat(cumulus): Adds support for additional relay state keys in parachain validation data inherent (paritytech#9262)

Adds the possibility for parachain clients to collect additional relay
state keys into the validation data inherent.

With this change, other consensus engines can collect additional relay
keys into the parachain inherent data:
```rs
let paras_inherent_data = ParachainInherentDataProvider::create_at(
  relay_parent,
  relay_client,
  validation_data,
  para_id,
  vec![
     relay_well_known_keys::EPOCH_INDEX.to_vec() // <----- Example
  ],
)
.await;
```

* Allow locking to bump consumer without limits (paritytech#9176)

Locking is a system-level operation, and can only increment the consumer
limit at most once. Therefore, it should use
`inc_consumer_without_limits`. This behavior is optional, and is only
used in the call path of `LockableCurrency`. Reserves, Holds and Freezes
(and other operations like transfer etc.) have the ability to return
`DispatchResult` and don't need this bypass. This is demonstrated in the
unit tests added.

Beyond this, this PR: 

* uses the correct way to get the account data in tests
* adds an `Unexpected` event instead of a silent `debug_assert!`. 
* Adds `try_state` checks for correctness of `account.frozen` invariant.

---------

Co-authored-by: Ankan <10196091+Ank4n@users.noreply.github.com>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* babe: keep stateless verification in `Verifier`, move everything else to the import queue (paritytech#9147)

We agreed to split paritytech#8446
into two PRs: one for BABE (this one) and one for AURA. This is the
easier one.

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Fix CandidateDescriptor debug logs (paritytech#9255)

Regardless of the descriptor version, the CandidateDescriptor was logged
as a CandidateDescriptorV2 instance.

To address this issue we now derive RuntimeDebug only when std is not
enabled so we can have that empty implementation that does not bloat the
runtime WASM. When std is enabled we implement core::fmt::Debug by hand
and print the
structure differently depending on the CandidateDescriptor version.

Fixes: paritytech#8457

---------

Signed-off-by: Alexandru Cihodaru <alexandru.cihodaru@parity.io>
Co-authored-by: Bastian Köcher <git@kchr.de>

* Rewrite validator disabling test with zombienet-sdk (paritytech#9128)

Fixes paritytech#9085

---------

Signed-off-by: Alexandru Cihodaru <alexandru.cihodaru@parity.io>

* gossip-support: make low connectivity message an error (paritytech#9264)

All is not well when a validator is not properly connected, e.g: of
things that might happen:
- Finality might be slightly delay because validator will be no-show
because they can't retrieve PoVs to validate approval work:
paritytech#8915.
- When they author blocks they won't back things because gossiping of
backing statements happen using the grid topology:, e.g blocks authored
by validators with a low number of peers:

https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frpc-polkadot.helixstreet.io#/explorer/query/26931262

https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frpc-polkadot.helixstreet.io#/explorer/query/26931260

https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fpolkadot.api.onfinality.io%2Fpublic-ws#/explorer/query/26931334

https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fpolkadot-public-rpc.blockops.network%2Fws#/explorer/query/26931314

https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fpolkadot-public-rpc.blockops.network%2Fws#/explorer/query/26931292

https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fpolkadot-public-rpc.blockops.network%2Fws#/explorer/query/26931447


The problem is seen in `polkadot_parachain_peer_count` metrics, but it
seems people are not monitoring that well enough, so let's make it more
visible nodes with low connectivity are not working in good conditions.

I also reduced the threshold to 85%, so that we don't trigger this error
to eagerly.

---------

Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Allow setting idle connection timeout value in custom node implementations (paritytech#9251)

Allow setting idle connection timeout value. This can be helpful in
custom networks to allow maintaining long-lived connections.

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* [revive] eth-decimals (paritytech#9101)

On Ethereum, 1 ETH is represented as 10^18 wei (wei being the smallest
unit).
On Polkadot 1 DOT is defined as 1010 plancks. It means that any value
smaller than 10^8 wei can not be expressed with the native balance. Any
contract that attempts to use such a value currently reverts with a
DecimalPrecisionLoss error.

In theory, RPC can define a decimal representation different from
Ethereum mainnet (10^18). In practice tools (frontend libraries,
wallets, and compilers) ignore it and expect 18 decimals.

The current behaviour breaks eth compatibility and needs to be updated.
See issue paritytech#109 for more details.


Fix  paritytech/contract-issues#109
[weights
compare](https://weights.tasty.limo/compare?unit=weight&ignore_errors=true&threshold=10&method=asymptotic&repo=polkadot-sdk&old=master&new=pg/eth-decimals&path_pattern=substrate/frame/**/src/weights.rs,polkadot/runtime/*/src/weights/**/*.rs,polkadot/bridges/modules/*/src/weights.rs,cumulus/**/weights/*.rs,cumulus/**/weights/xcm/*.rs,cumulus/**/src/weights.rs)

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Rewrite old disputes test with zombienet-sdk (paritytech#9257)

Fixes: paritytech#9256

---------

Signed-off-by: Alexandru Cihodaru <alexandru.cihodaru@parity.io>

* Zombienet CI improvements (paritytech#9172)

## 🔄 Zombienet CI Refactor: Matrix-Based Workflows

This PR refactors the Zombienet CI workflows to use a **matrix-based
approach**, resulting in:

- ✅ **Easier test maintenance** – easily add or remove tests without
duplicating workflow logic.
- 🩹 **Improved flaky test handling** – flaky tests are excluded by
default but can be explicitly included by pattern.
- 🔍 **Pattern-based test selection** – run only tests matching a name
pattern, ideal for debugging.

---

## 🗂️ Structure Changes

- **Test definitions** are now stored in `.github/zombienet-tests/`.
- Each workflow (`Cumulus`, `Substrate`, `Polkadot`, `Parachain
Template`) has its own YAML file with test configurations.

---

## 🧰 Added Scripts

### `.github/scripts/parse-zombienet-tests.py`
- Parses test definitions and generates a GitHub Actions matrix.
- Filters out flaky tests by default.
- If a `test_pattern` is provided, matching tests are **included even if
flaky**.

### `.github/scripts/dispatch-zombienet-workflow.sh`
- Triggers a Zombienet workflow multiple times, optionally filtered by
test name pattern.
- Stores results in a **CSV file** for analysis.
- Useful for debugging flaky tests or stress-testing specific workflows.
- Intended to be run from the local machine.

---------

Co-authored-by: Javier Viola <363911+pepoviola@users.noreply.github.com>
Co-authored-by: Alexander Samusev <41779041+alvicsam@users.noreply.github.com>
Co-authored-by: Javier Viola <javier@parity.io>

* consensus/grandpa: Fix high number of peer disconnects with invalid justification (paritytech#9015)

A grandpa race-casse has been identified in the versi-net stack around
authority set changes, which leads to the following:

- T0 / Node A: Completes round (15)
- T1 / Node A: Applies new authority set change and increments the SetID
(from 0 to 1)
- T2 / Node B: Sends Precommit for round (15) with SetID (0) -- previous
set ID
- T3 / Node B: Applies new authority set change and increments the SetID
(1)

In this scenario, Node B is not aware at the moment of sending
justifications that the Set ID has changed.
The downstream effect is that Node A will not be able to verify the
signature of justifications, since a different SetID is taken into
account. This will cascade through the sync engine, where the Node B is
wrongfully banned and disconnected.

This PR aims to fix the edge-case by making the grandpa resilient to
verifying prior setIDs for signatures.
When the signature of the grandpa justification fails to decode, the
prior SetID is also verified. If the prior SetID produces a valid
signature, then the outdated justification error is propagated through
the code (ie `SignatureResult::OutdatedSet`).

The sync engine will handle the outdated justifications as invalid, but
without banning the peer. This leads to increased stability of the
network during authority changes, which caused frequent disconnects to
versi-net in the past.

### Review Notes
- Main changes that verify prior SetId on failures are placed in
[check_message_signature_with_buffer](https://github.com/paritytech/polkadot-sdk/pull/9015/files#diff-359d7a46ea285177e5d86979f62f0f04baabf65d595c61bfe44b6fc01af70d89R458-R501)
- Sync engine no longer disconnects outdated justifications in
[process_service_command](https://github.com/paritytech/polkadot-sdk/pull/9015/files#diff-9ab3391aa82ee2b2868ece610100f84502edcf40638dba9ed6953b6e572dfba5R678-R703)

### Testing Done
- Deployed the PR to versi-net with 40 validators
- Prior we have noticed 10/40 validators disconnecting every 15-20
minutes, leading to instability
- Over past 24h the issue has been mitigated:
https://grafana.teleport.parity.io/goto/FPNWlmsHR?orgId=1
- Note: bootnodes 0 and 1 are currently running outdated versions that
do not incorporate this SetID verification improvement

Closes: paritytech#8872
Closes: paritytech#1147

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Dmitry Markin <dmitry@markin.tech>

* network: Upgrade litep2p to v0.10.0 (paritytech#9287)

## litep2p v0.10.0

This release adds the ability to use system DNS resolver and change
Kademlia DNS memory store capacity. It also fixes the Bitswap protocol
implementation and correctly handles the dropped notification substreams
by unregistering them from the protocol list.

### Added

- kad: Expose memory store configuration
([paritytech#407](paritytech/litep2p#407))
- transport: Allow changing DNS resolver config
([paritytech#384](paritytech/litep2p#384))

### Fixed

- notification: Unregister dropped protocols
([paritytech#391](paritytech/litep2p#391))
- bitswap: Fix protocol implementation
([paritytech#402](paritytech/litep2p#402))
- transport-manager: stricter supported multiaddress check
([paritytech#403](paritytech/litep2p#403))

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Dedup dependencies between dependencies and dev-dependencies (paritytech#9233)

# Description

Deduplicate some dependencies between `dependencies` and
`dev-dependencies` sections

---------

Co-authored-by: Bastian Köcher <git@kchr.de>

* Ci-unified update (with solc and resolc) (paritytech#9289)

add `solc` and `resolc` binaries to image

```
$ solc --version
solc, the solidity compiler commandline interface
Version: 0.8.30+commit.73712a01.Linux.g++
$ resolc --version
Solidity frontend for the revive compiler version 0.3.0+commit.ed60869.llvm-18.1.8
```

You can update or install specific version with `/builds/download-bin.sh
<solc | resolc> [version | latest]`
e.g.
```
/builds/download-bin.sh solc v0.8.30
```

* fix: skip verifying imported blocks (paritytech#9280)

Closes paritytech#9277. Still WIP
testing

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* [Staking Async] Saturating accrue era reward points (paritytech#9186)

Replaces regular addition with saturating addition when accumulating era
reward points in `pallet-staking-async` to prevent potential overflow.

---------

Co-authored-by: Bastian Köcher <git@kchr.de>

* Replace `log` with `tracing` on `pallet-bridge-grandpa` (paritytech#9294)

This PR replaces `log` with `tracing` instrumentation on
`pallet-bridge-grandpa` by providing structured logging.

Partially addresses paritytech#9211

* Fix subsume_assets incorrectly merging two AssetsInHolding (paritytech#9179)

`subsume_assets` fails to correctly subsume two instances of
`AssetsInHolding` under certain conditions which can result in loss of
funds (as assets are overriden rather than summed together)

Eg. consider following test:
```
	#[test]
	fn subsume_assets_different_length_holdings() {
		let mut t1 = AssetsInHolding::new();
		t1.subsume(CFP(400));

		let mut t2 = AssetsInHolding::new();
		t2.subsume(CF(100));
		t2.subsume(CFP(100));

		t1.subsume_assets(t2);
```

current result (without this PR change):
```
		let mut iter = t1.into_assets_iter();
		assert_eq!(Some(CF(100)), iter.next());
		assert_eq!(Some(CFP(100)), iter.next());
```

expected result:
```
		let mut iter = t1.into_assets_iter();
		assert_eq!(Some(CF(100)), iter.next());
		assert_eq!(Some(CFP(500)), iter.next());
```

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Branislav Kontur <bkontur@gmail.com>

* yap-runtime: fixes for `GetParachainInfo` (paritytech#9312)

This fixes the YAP parachain runtimes in case you encounter a panic in
the collator similar to
paritytech/zombienet#2050:
```
Failed to retrieve the parachain id
```
(which we do have zombienet-sdk tests for
[here](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/client/transaction-pool/tests/zombienet/yap_test.rs))

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* RecentDisputes/ActiveDisputes use BTreeMap instead of Vec (paritytech#9309)

Fixes paritytech#782

---------

Signed-off-by: Alexandru Cihodaru <alexandru.cihodaru@parity.io>

* network/litep2p: Switch to system DNS resolver (paritytech#9321)

Switch to system DNS resolver instead of 8.8.8.8 that litep2p uses by
default. This enables full administrator control of what upstream DNS
servers to use, including resolution of local names using custom DNS
servers.

Fixes paritytech#9298.

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* litep2p/discovery: Ensure non-global addresses are not reported as external (paritytech#9281)

This PR ensures that external addresses discovered by the identify
protocol are not propagated to the litep2p backend if they are not
global. This leads to a healthier DHT over time, since nodes will not
advertise loopback / non-global addresses.

We have seen various cases were loopback addresses were reported as
external:

```
2025-07-16 16:18:39.765 TRACE tokio-runtime-worker sub-libp2p::discovery: verify new external address: /ip4/127.0.0.1/tcp/30310/p2p/12D3KooWNw19ScMjzNGLnYYLQxWcM9EK9VYPbCq241araUGgbdLM    

2025-07-16 16:18:39.765  INFO tokio-runtime-worker sub-libp2p: 🔍 Discovered new external address for our node: /ip4/127.0.0.1/tcp/30310/p2p/12D3KooWNw19ScMjzNGLnYYLQxWcM9EK9VYPbCq241araUGgbdLM
```

This PR takes into account the network config for
`allow_non_global_addresses`.

Closes: paritytech#9261

cc @paritytech/networking

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* [Backport] Regular version bumps and prdoc reordering from the stable2506 release branch back to master (paritytech#9320)

This PR backports:
- NODE_VERSION bumps
- spec_version bumps
- prdoc reordering
from the release branch back to master

---------

Co-authored-by: ParityReleases <release-team@parity.io>

* add node version to the announcement message

* test in the internal room

---------

Signed-off-by: Alexandru Cihodaru <alexandru.cihodaru@parity.io>
Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: Diego <diego2737@gmail.com>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Branislav Kontur <bkontur@gmail.com>
Co-authored-by: Anthony Kveder <32168055+antkve@users.noreply.github.com>
Co-authored-by: Karol Kokoszka <karol@parity.io>
Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: Javier Viola <363911+pepoviola@users.noreply.github.com>
Co-authored-by: Rodrigo Quelhas <22591718+RomarQ@users.noreply.github.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Ankan <10196091+Ank4n@users.noreply.github.com>
Co-authored-by: sistemd <enntheprogrammer@gmail.com>
Co-authored-by: Alexandru Cihodaru <40807189+AlexandruCihodaru@users.noreply.github.com>
Co-authored-by: Alexandru Gheorghe <49718502+alexggh@users.noreply.github.com>
Co-authored-by: Dmitry Markin <dmitry@markin.tech>
Co-authored-by: PG Herveou <pgherveou@gmail.com>
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Lukasz Rubaszewski <117115317+lrubasze@users.noreply.github.com>
Co-authored-by: Alexander Samusev <41779041+alvicsam@users.noreply.github.com>
Co-authored-by: Javier Viola <javier@parity.io>
Co-authored-by: Alexandru Vasile <60601340+lexnv@users.noreply.github.com>
Co-authored-by: Evgeny Snitko <evgeny@parity.io>
Co-authored-by: Raymond Cheung <178801527+raymondkfcheung@users.noreply.github.com>
Co-authored-by: ordian <4211399+ordian@users.noreply.github.com>
Co-authored-by: ParityReleases <release-team@parity.io>
athei added a commit that referenced this pull request Aug 14, 2025
On Ethereum, 1 ETH is represented as 10^18 wei (wei being the smallest
unit).
On Polkadot 1 DOT is defined as 1010 plancks. It means that any value
smaller than 10^8 wei can not be expressed with the native balance. Any
contract that attempts to use such a value currently reverts with a
DecimalPrecisionLoss error.

In theory, RPC can define a decimal representation different from
Ethereum mainnet (10^18). In practice tools (frontend libraries,
wallets, and compilers) ignore it and expect 18 decimals.

The current behaviour breaks eth compatibility and needs to be updated.
See issue #109 for more details.


Fix  paritytech/contract-issues#109
[weights
compare](https://weights.tasty.limo/compare?unit=weight&ignore_errors=true&threshold=10&method=asymptotic&repo=polkadot-sdk&old=master&new=pg/eth-decimals&path_pattern=substrate/frame/**/src/weights.rs,polkadot/runtime/*/src/weights/**/*.rs,polkadot/bridges/modules/*/src/weights.rs,cumulus/**/weights/*.rs,cumulus/**/weights/xcm/*.rs,cumulus/**/src/weights.rs)

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
@athei athei mentioned this pull request Aug 14, 2025
athei added a commit that referenced this pull request Aug 15, 2025
- #9112
- #9101
- #9416
- #9357
- #9441
- #9267

Those are all the changes we want to get onto the next Kusama release.
The new gas mapping and EVM backend will not make it.

---------

Co-authored-by: PG Herveou <pgherveou@gmail.com>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: sekiseki <22696121+sekisamu@users.noreply.github.com>
Co-authored-by: Michael Müller <mich@elmueller.net>
sinzii added a commit to dedotdev/dedot that referenced this pull request Sep 18, 2025
There is a breaking change introduced from `pallet-revive` which
replaced the storage `ContractInfoOf` by the `AccountInfoOf`. This work
is to comply with this new change.

Related PR: paritytech/polkadot-sdk#9101
Code Change:
https://github.com/paritytech/polkadot-sdk/pull/9101/files#diff-f55a8416f5e8564cb4463b5f11dfd00d7c865aabab747a05887feeedd4e1c81dL498-L502
VictorMurray22 added a commit to VictorMurray22/dedot that referenced this pull request Sep 18, 2025
There is a breaking change introduced from `pallet-revive` which
replaced the storage `ContractInfoOf` by the `AccountInfoOf`. This work
is to comply with this new change.

Related PR: paritytech/polkadot-sdk#9101
Code Change:
https://github.com/paritytech/polkadot-sdk/pull/9101/files#diff-f55a8416f5e8564cb4463b5f11dfd00d7c865aabab747a05887feeedd4e1c81dL498-L502
alvicsam pushed a commit that referenced this pull request Oct 17, 2025
On Ethereum, 1 ETH is represented as 10^18 wei (wei being the smallest
unit).
On Polkadot 1 DOT is defined as 1010 plancks. It means that any value
smaller than 10^8 wei can not be expressed with the native balance. Any
contract that attempts to use such a value currently reverts with a
DecimalPrecisionLoss error.

In theory, RPC can define a decimal representation different from
Ethereum mainnet (10^18). In practice tools (frontend libraries,
wallets, and compilers) ignore it and expect 18 decimals.

The current behaviour breaks eth compatibility and needs to be updated.
See issue #109 for more details.


Fix  paritytech/contract-issues#109
[weights
compare](https://weights.tasty.limo/compare?unit=weight&ignore_errors=true&threshold=10&method=asymptotic&repo=polkadot-sdk&old=master&new=pg/eth-decimals&path_pattern=substrate/frame/**/src/weights.rs,polkadot/runtime/*/src/weights/**/*.rs,polkadot/bridges/modules/*/src/weights.rs,cumulus/**/weights/*.rs,cumulus/**/weights/xcm/*.rs,cumulus/**/src/weights.rs)

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T7-smart_contracts This PR/Issue is related to smart contracts.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Precision Loss During ETH-to-DOT Conversion Causes removeLiquidityETH Test Failures

5 participants