Skip to content

Commit 08d3f75

Browse files
committed
upgrade polkadot-sdk to stable2412
1 parent 931a708 commit 08d3f75

File tree

54 files changed

+4435
-2074
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+4435
-2074
lines changed

Cargo.lock

Lines changed: 4058 additions & 1764 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 87 additions & 76 deletions
Large diffs are not rendered by default.

client/api/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ targets = ["x86_64-unknown-linux-gnu"]
1212

1313
[dependencies]
1414
async-trait = { workspace = true }
15-
scale-codec = { package = "parity-scale-codec", workspace = true }
15+
scale-codec = { workspace = true }
1616
# Substrate
1717
sp-core = { workspace = true, features = ["default"] }
1818
sp-runtime = { workspace = true, features = ["default"] }

client/cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ fp-storage = { workspace = true, features = ["default"] }
2727

2828
[dev-dependencies]
2929
futures = { workspace = true }
30-
scale-codec = { package = "parity-scale-codec", workspace = true }
30+
scale-codec = { workspace = true }
3131
tempfile = "3.3.0"
3232
# Substrate
3333
sc-block-builder = { workspace = true }

client/db/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ targets = ["x86_64-unknown-linux-gnu"]
1212

1313
[dependencies]
1414
async-trait = { workspace = true }
15-
ethereum = { workspace = true, features = ["with-codec"], optional = true }
15+
ethereum = { workspace = true, features = ["with-scale"], optional = true }
1616
futures = { workspace = true, optional = true }
1717
kvdb-rocksdb = { workspace = true, optional = true }
1818
log = { workspace = true }
1919
parity-db = { workspace = true }
2020
parking_lot = { workspace = true }
21-
scale-codec = { package = "parity-scale-codec", workspace = true }
21+
scale-codec = { workspace = true }
2222
smallvec = { version = "1.13", optional = true }
2323
sqlx = { workspace = true, features = ["runtime-tokio-native-tls", "sqlite"], optional = true }
2424
tokio = { workspace = true, features = ["macros", "sync"], optional = true }

client/mapping-sync/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ fp-rpc = { workspace = true, features = ["default"] }
3333
[dev-dependencies]
3434
ethereum = { workspace = true }
3535
ethereum-types = { workspace = true }
36-
scale-codec = { package = "parity-scale-codec", workspace = true }
36+
scale-codec = { workspace = true }
3737
sqlx = { workspace = true, features = ["runtime-tokio-native-tls", "sqlite"] }
3838
tempfile = "3.14.0"
3939
tokio = { workspace = true, features = ["sync"] }

client/rpc-core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repository = { workspace = true }
1111
targets = ["x86_64-unknown-linux-gnu"]
1212

1313
[dependencies]
14-
ethereum = { workspace = true, features = ["with-codec", "with-serde"] }
14+
ethereum = { workspace = true, features = ["with-scale", "with-serde"] }
1515
ethereum-types = { workspace = true }
1616
jsonrpsee = { workspace = true, features = ["server", "macros"] }
1717
rlp = { workspace = true }

client/rpc-core/src/types/transaction.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ impl BuildFrom for Transaction {
108108
access_list: None,
109109
y_parity: None,
110110
v: Some(U256::from(t.signature.v())),
111-
r: U256::from(t.signature.r().as_bytes()),
112-
s: U256::from(t.signature.s().as_bytes()),
111+
r: U256::from_big_endian(t.signature.r().as_bytes()),
112+
s: U256::from_big_endian(t.signature.s().as_bytes()),
113113
},
114114
EthereumTransaction::EIP2930(t) => Self {
115115
transaction_type: U256::from(1),
@@ -134,8 +134,8 @@ impl BuildFrom for Transaction {
134134
access_list: Some(t.access_list.clone()),
135135
y_parity: Some(U256::from(t.odd_y_parity as u8)),
136136
v: Some(U256::from(t.odd_y_parity as u8)),
137-
r: U256::from(t.r.as_bytes()),
138-
s: U256::from(t.s.as_bytes()),
137+
r: U256::from_big_endian(t.r.as_bytes()),
138+
s: U256::from_big_endian(t.s.as_bytes()),
139139
},
140140
EthereumTransaction::EIP1559(t) => Self {
141141
transaction_type: U256::from(2),
@@ -161,8 +161,8 @@ impl BuildFrom for Transaction {
161161
access_list: Some(t.access_list.clone()),
162162
y_parity: Some(U256::from(t.odd_y_parity as u8)),
163163
v: Some(U256::from(t.odd_y_parity as u8)),
164-
r: U256::from(t.r.as_bytes()),
165-
s: U256::from(t.s.as_bytes()),
164+
r: U256::from_big_endian(t.r.as_bytes()),
165+
s: U256::from_big_endian(t.s.as_bytes()),
166166
},
167167
}
168168
}

client/rpc/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repository = { workspace = true }
1111
targets = ["x86_64-unknown-linux-gnu"]
1212

1313
[dependencies]
14-
ethereum = { workspace = true, features = ["with-codec"] }
14+
ethereum = { workspace = true, features = ["with-scale"] }
1515
ethereum-types = { workspace = true }
1616
evm = { workspace = true }
1717
futures = { workspace = true }
@@ -22,7 +22,7 @@ log = { workspace = true }
2222
prometheus = { version = "0.13.4", default-features = false }
2323
rand = "0.8"
2424
rlp = { workspace = true }
25-
scale-codec = { package = "parity-scale-codec", workspace = true }
25+
scale-codec = { workspace = true }
2626
schnellru = "0.2.3"
2727
serde = { workspace = true, optional = true }
2828
thiserror = { workspace = true }

client/rpc/src/eth/block.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// You should have received a copy of the GNU General Public License
1717
// along with this program. If not, see <https://www.gnu.org/licenses/>.
1818

19-
use std::sync::Arc;
19+
use std::{ops::Deref, sync::Arc};
2020

2121
use ethereum_types::{H256, U256};
2222
use jsonrpsee::core::RpcResult;
@@ -147,7 +147,7 @@ where
147147
graph
148148
.validated_pool()
149149
.ready()
150-
.map(|in_pool_tx| in_pool_tx.data().clone())
150+
.map(|in_pool_tx| in_pool_tx.data().deref().clone())
151151
.collect::<Vec<<B as BlockT>::Extrinsic>>(),
152152
);
153153

@@ -157,7 +157,7 @@ where
157157
.validated_pool()
158158
.futures()
159159
.iter()
160-
.map(|(_hash, extrinsic)| extrinsic.clone())
160+
.map(|(_hash, extrinsic)| extrinsic.deref().clone())
161161
.collect::<Vec<<B as BlockT>::Extrinsic>>(),
162162
);
163163

client/rpc/src/eth/execute.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ pub fn error_on_execution_failure(reason: &ExitReason, data: &[u8]) -> RpcResult
979979
// should contain a utf-8 encoded revert reason.
980980
if data.len() > MESSAGE_START {
981981
let message_len =
982-
U256::from(&data[LEN_START..MESSAGE_START]).saturated_into::<usize>();
982+
U256::from_big_endian(&data[LEN_START..MESSAGE_START]).saturated_into::<usize>();
983983
let message_end = MESSAGE_START.saturating_add(message_len);
984984

985985
if data.len() >= message_end {

client/rpc/src/eth/filter.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use std::{
2020
collections::{BTreeMap, HashSet},
2121
marker::PhantomData,
22+
ops::Deref,
2223
sync::Arc,
2324
time::{Duration, Instant},
2425
};
@@ -111,7 +112,7 @@ where
111112
.graph
112113
.validated_pool()
113114
.ready()
114-
.map(|in_pool_tx| in_pool_tx.data().clone())
115+
.map(|in_pool_tx| in_pool_tx.data().deref().clone())
115116
.collect();
116117
// Use the runtime to match the (here) opaque extrinsics against ethereum transactions.
117118
let api = self.client.runtime_api();
@@ -225,7 +226,7 @@ where
225226
.graph
226227
.validated_pool()
227228
.ready()
228-
.map(|in_pool_tx| in_pool_tx.data().clone())
229+
.map(|in_pool_tx| in_pool_tx.data().deref().clone())
229230
.collect();
230231
// Use the runtime to match the (here) opaque extrinsics against ethereum transactions.
231232
let api = self.client.runtime_api();

client/rpc/src/eth/pending.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
// You should have received a copy of the GNU General Public License
1717
// along with this program. If not, see <https://www.gnu.org/licenses/>.
1818

19+
use std::ops::Deref;
20+
1921
// Substrate
2022
use sc_client_api::backend::{Backend, StorageProvider};
2123
use sc_transaction_pool::ChainApi;
@@ -125,7 +127,7 @@ where
125127
.graph
126128
.validated_pool()
127129
.ready()
128-
.map(|in_pool_tx| in_pool_tx.data().clone())
130+
.map(|in_pool_tx| in_pool_tx.data().deref().clone())
129131
.collect::<Vec<<B as BlockT>::Extrinsic>>();
130132
log::debug!(target: LOG_TARGET, "Pending runtime API: extrinsic len = {}", extrinsics.len());
131133
// Apply the extrinsics from the ready queue to the pending block's state.

client/rpc/src/eth/transaction.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// You should have received a copy of the GNU General Public License
1717
// along with this program. If not, see <https://www.gnu.org/licenses/>.
1818

19-
use std::sync::Arc;
19+
use std::{ops::Deref, sync::Arc};
2020

2121
use ethereum::TransactionV2 as EthereumTransaction;
2222
use ethereum_types::{H256, U256, U64};
@@ -81,7 +81,7 @@ where
8181
graph
8282
.validated_pool()
8383
.ready()
84-
.map(|in_pool_tx| in_pool_tx.data().clone())
84+
.map(|in_pool_tx| in_pool_tx.data().deref().clone())
8585
.collect::<Vec<<B as BlockT>::Extrinsic>>(),
8686
);
8787

@@ -91,7 +91,7 @@ where
9191
.validated_pool()
9292
.futures()
9393
.iter()
94-
.map(|(_hash, extrinsic)| extrinsic.clone())
94+
.map(|(_hash, extrinsic)| extrinsic.deref().clone())
9595
.collect::<Vec<<B as BlockT>::Extrinsic>>(),
9696
);
9797

client/rpc/src/eth_pubsub.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// You should have received a copy of the GNU General Public License
1717
// along with this program. If not, see <https://www.gnu.org/licenses/>.
1818

19-
use std::{marker::PhantomData, sync::Arc};
19+
use std::{marker::PhantomData, ops::Deref, sync::Arc};
2020

2121
use ethereum::TransactionV2 as EthereumTransaction;
2222
use futures::{future, FutureExt as _, StreamExt as _};
@@ -165,7 +165,7 @@ where
165165
return future::ready(None);
166166
};
167167

168-
let xts = vec![xt.data().clone()];
168+
let xts = vec![xt.data().deref().clone()];
169169

170170
let txs: Option<Vec<EthereumTransaction>> = if api_version > 1 {
171171
api.extrinsic_filter(best_block, xts).ok()

client/rpc/src/txpool.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// You should have received a copy of the GNU General Public License
1717
// along with this program. If not, see <https://www.gnu.org/licenses/>.
1818

19-
use std::{marker::PhantomData, sync::Arc};
19+
use std::{marker::PhantomData, ops::Deref, sync::Arc};
2020

2121
use ethereum::TransactionV2 as EthereumTransaction;
2222
use ethereum_types::{H160, H256, U256};
@@ -109,7 +109,7 @@ where
109109
.graph
110110
.validated_pool()
111111
.ready()
112-
.map(|in_pool_tx| in_pool_tx.data().clone())
112+
.map(|in_pool_tx| in_pool_tx.data().deref().clone())
113113
.collect();
114114

115115
// Collect extrinsics in the future validated pool.
@@ -118,7 +118,7 @@ where
118118
.validated_pool()
119119
.futures()
120120
.iter()
121-
.map(|(_, extrinsic)| extrinsic.clone())
121+
.map(|(_, extrinsic)| extrinsic.deref().clone())
122122
.collect();
123123

124124
// Use the runtime to match the (here) opaque extrinsics against ethereum transactions.

client/storage/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ repository = { workspace = true }
1111
targets = ["x86_64-unknown-linux-gnu"]
1212

1313
[dependencies]
14-
ethereum = { workspace = true, features = ["with-codec"] }
14+
ethereum = { workspace = true, features = ["with-scale"] }
1515
ethereum-types = { workspace = true }
16-
scale-codec = { package = "parity-scale-codec", workspace = true }
16+
scale-codec = { workspace = true }
1717

1818
# Substrate
1919
sc-client-api = { workspace = true }

client/storage/src/overrides/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ where
124124

125125
pub fn account_storage(&self, at: B::Hash, address: Address, index: U256) -> Option<H256> {
126126
let tmp: &mut [u8; 32] = &mut [0; 32];
127-
index.to_big_endian(tmp);
127+
index.write_as_big_endian(tmp);
128128

129129
let mut key: Vec<u8> = storage_prefix_build(PALLET_EVM, EVM_ACCOUNT_STORAGES);
130130
key.extend(blake2_128_extend(address.as_bytes()));

frame/base-fee/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repository = { workspace = true }
1111
targets = ["x86_64-unknown-linux-gnu"]
1212

1313
[dependencies]
14-
scale-codec = { package = "parity-scale-codec", workspace = true }
14+
scale-codec = { workspace = true }
1515
scale-info = { workspace = true }
1616
# Substrate
1717
frame-support = { workspace = true }

frame/dynamic-fee/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repository = { workspace = true }
1111
targets = ["x86_64-unknown-linux-gnu"]
1212

1313
[dependencies]
14-
scale-codec = { package = "parity-scale-codec", workspace = true }
14+
scale-codec = { workspace = true }
1515
scale-info = { workspace = true }
1616
# Substrate
1717
frame-support = { workspace = true }

frame/ethereum/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ repository = { workspace = true }
1111
targets = ["x86_64-unknown-linux-gnu"]
1212

1313
[dependencies]
14-
ethereum = { workspace = true, features = ["with-codec"] }
14+
ethereum = { workspace = true, features = ["with-scale"] }
1515
ethereum-types = { workspace = true }
1616
evm = { workspace = true, features = ["with-codec"] }
17-
scale-codec = { package = "parity-scale-codec", workspace = true }
17+
scale-codec = { workspace = true }
1818
scale-info = { workspace = true }
1919
# Substrate
2020
frame-support = { workspace = true }

frame/ethereum/src/lib.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,10 @@ where
137137
len: usize,
138138
) -> Option<Result<(), TransactionValidityError>> {
139139
if let Call::transact { transaction } = self {
140-
if let Err(e) = CheckWeight::<T>::do_pre_dispatch(dispatch_info, len) {
140+
if let Err(e) =
141+
CheckWeight::<T>::do_validate(dispatch_info, len).and_then(|(_, next_len)| {
142+
CheckWeight::<T>::do_prepare(dispatch_info, len, next_len)
143+
}) {
141144
return Some(Err(e));
142145
}
143146

@@ -629,7 +632,7 @@ impl<T: Config> Pallet<T> {
629632
let data = info.value;
630633
let data_len = data.len();
631634
if data_len > MESSAGE_START {
632-
let message_len = U256::from(&data[LEN_START..MESSAGE_START])
635+
let message_len = U256::from_big_endian(&data[LEN_START..MESSAGE_START])
633636
.saturated_into::<usize>();
634637
let message_end = MESSAGE_START.saturating_add(
635638
message_len.min(T::ExtraDataLength::get() as usize),

frame/evm-chain-id/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repository = { workspace = true }
1111
targets = ["x86_64-unknown-linux-gnu"]
1212

1313
[dependencies]
14-
scale-codec = { package = "parity-scale-codec", workspace = true }
14+
scale-codec = { workspace = true }
1515
scale-info = { workspace = true }
1616
# Substrate
1717
frame-support = { workspace = true }

frame/evm/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ hash-db = { workspace = true }
1818
hex-literal = { workspace = true }
1919
impl-trait-for-tuples = "0.2.3"
2020
log = { workspace = true }
21-
scale-codec = { package = "parity-scale-codec", workspace = true }
21+
scale-codec = { workspace = true }
2222
scale-info = { workspace = true }
2323
# Substrate
2424
frame-benchmarking = { workspace = true, optional = true }
@@ -43,7 +43,7 @@ default = ["std"]
4343
std = [
4444
"environmental?/std",
4545
"evm/std",
46-
"evm/with-serde",
46+
"evm/serde",
4747
"hex/std",
4848
"log/std",
4949
"scale-codec/std",

frame/evm/precompile/bn128/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,7 @@ impl Precompile for Bn128Pairing {
282282
}
283283
};
284284

285-
let mut buf = [0u8; 32];
286-
ret_val.to_big_endian(&mut buf);
285+
let buf = ret_val.to_big_endian();
287286

288287
Ok(PrecompileOutput {
289288
exit_status: ExitSucceed::Returned,

frame/evm/precompile/dispatch/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ edition = { workspace = true }
88
repository = { workspace = true }
99

1010
[dependencies]
11-
scale-codec = { package = "parity-scale-codec", workspace = true }
11+
scale-codec = { workspace = true }
1212
# Substrate
1313
frame-support = { workspace = true }
1414
sp-runtime = { workspace = true }

0 commit comments

Comments
 (0)