-
Notifications
You must be signed in to change notification settings - Fork 515
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
Upgrade polkadot-sdk
to stable2412
#1595
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -16,7 +16,7 @@ | |||||
// You should have received a copy of the GNU General Public License | ||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>. | ||||||
|
||||||
use std::sync::Arc; | ||||||
use std::{ops::Deref, sync::Arc}; | ||||||
|
||||||
use ethereum_types::{H256, U256}; | ||||||
use jsonrpsee::core::RpcResult; | ||||||
|
@@ -147,7 +147,7 @@ where | |||||
graph | ||||||
.validated_pool() | ||||||
.ready() | ||||||
.map(|in_pool_tx| in_pool_tx.data().clone()) | ||||||
.map(|in_pool_tx| in_pool_tx.data().deref().clone()) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
.collect::<Vec<<B as BlockT>::Extrinsic>>(), | ||||||
); | ||||||
|
||||||
|
@@ -157,7 +157,7 @@ where | |||||
.validated_pool() | ||||||
.futures() | ||||||
.iter() | ||||||
.map(|(_hash, extrinsic)| extrinsic.clone()) | ||||||
.map(|(_hash, extrinsic)| extrinsic.deref().clone()) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
.collect::<Vec<<B as BlockT>::Extrinsic>>(), | ||||||
); | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -19,6 +19,7 @@ | |||||
use std::{ | ||||||
collections::{BTreeMap, HashSet}, | ||||||
marker::PhantomData, | ||||||
ops::Deref, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
sync::Arc, | ||||||
time::{Duration, Instant}, | ||||||
}; | ||||||
|
@@ -111,7 +112,7 @@ where | |||||
.graph | ||||||
.validated_pool() | ||||||
.ready() | ||||||
.map(|in_pool_tx| in_pool_tx.data().clone()) | ||||||
.map(|in_pool_tx| in_pool_tx.data().deref().clone()) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
.collect(); | ||||||
// Use the runtime to match the (here) opaque extrinsics against ethereum transactions. | ||||||
let api = self.client.runtime_api(); | ||||||
|
@@ -225,7 +226,7 @@ where | |||||
.graph | ||||||
.validated_pool() | ||||||
.ready() | ||||||
.map(|in_pool_tx| in_pool_tx.data().clone()) | ||||||
.map(|in_pool_tx| in_pool_tx.data().deref().clone()) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
.collect(); | ||||||
// Use the runtime to match the (here) opaque extrinsics against ethereum transactions. | ||||||
let api = self.client.runtime_api(); | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -16,6 +16,8 @@ | |||||
// You should have received a copy of the GNU General Public License | ||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>. | ||||||
|
||||||
use std::ops::Deref; | ||||||
|
||||||
Comment on lines
+19
to
+20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
// Substrate | ||||||
use sc_client_api::backend::{Backend, StorageProvider}; | ||||||
use sc_transaction_pool::ChainApi; | ||||||
|
@@ -125,7 +127,7 @@ where | |||||
.graph | ||||||
.validated_pool() | ||||||
.ready() | ||||||
.map(|in_pool_tx| in_pool_tx.data().clone()) | ||||||
.map(|in_pool_tx| in_pool_tx.data().deref().clone()) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
.collect::<Vec<<B as BlockT>::Extrinsic>>(); | ||||||
log::debug!(target: LOG_TARGET, "Pending runtime API: extrinsic len = {}", extrinsics.len()); | ||||||
// Apply the extrinsics from the ready queue to the pending block's state. | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -16,7 +16,7 @@ | |||||
// You should have received a copy of the GNU General Public License | ||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>. | ||||||
|
||||||
use std::sync::Arc; | ||||||
use std::{ops::Deref, sync::Arc}; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
use ethereum::TransactionV2 as EthereumTransaction; | ||||||
use ethereum_types::{H256, U256, U64}; | ||||||
|
@@ -81,7 +81,7 @@ where | |||||
graph | ||||||
.validated_pool() | ||||||
.ready() | ||||||
.map(|in_pool_tx| in_pool_tx.data().clone()) | ||||||
.map(|in_pool_tx| in_pool_tx.data().deref().clone()) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
.collect::<Vec<<B as BlockT>::Extrinsic>>(), | ||||||
); | ||||||
|
||||||
|
@@ -91,7 +91,7 @@ where | |||||
.validated_pool() | ||||||
.futures() | ||||||
.iter() | ||||||
.map(|(_hash, extrinsic)| extrinsic.clone()) | ||||||
.map(|(_hash, extrinsic)| extrinsic.deref().clone()) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
.collect::<Vec<<B as BlockT>::Extrinsic>>(), | ||||||
); | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -16,7 +16,7 @@ | |||||
// You should have received a copy of the GNU General Public License | ||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>. | ||||||
|
||||||
use std::{marker::PhantomData, sync::Arc}; | ||||||
use std::{marker::PhantomData, ops::Deref, sync::Arc}; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
use ethereum::TransactionV2 as EthereumTransaction; | ||||||
use futures::{future, FutureExt as _, StreamExt as _}; | ||||||
|
@@ -165,7 +165,7 @@ where | |||||
return future::ready(None); | ||||||
}; | ||||||
|
||||||
let xts = vec![xt.data().clone()]; | ||||||
let xts = vec![xt.data().deref().clone()]; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
let txs: Option<Vec<EthereumTransaction>> = if api_version > 1 { | ||||||
api.extrinsic_filter(best_block, xts).ok() | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -16,7 +16,7 @@ | |||||
// You should have received a copy of the GNU General Public License | ||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>. | ||||||
|
||||||
use std::{marker::PhantomData, sync::Arc}; | ||||||
use std::{marker::PhantomData, ops::Deref, sync::Arc}; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
use ethereum::TransactionV2 as EthereumTransaction; | ||||||
use ethereum_types::{H160, H256, U256}; | ||||||
|
@@ -109,7 +109,7 @@ where | |||||
.graph | ||||||
.validated_pool() | ||||||
.ready() | ||||||
.map(|in_pool_tx| in_pool_tx.data().clone()) | ||||||
.map(|in_pool_tx| in_pool_tx.data().deref().clone()) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
.collect(); | ||||||
|
||||||
// Collect extrinsics in the future validated pool. | ||||||
|
@@ -118,7 +118,7 @@ where | |||||
.validated_pool() | ||||||
.futures() | ||||||
.iter() | ||||||
.map(|(_, extrinsic)| extrinsic.clone()) | ||||||
.map(|(_, extrinsic)| extrinsic.deref().clone()) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
.collect(); | ||||||
|
||||||
// Use the runtime to match the (here) opaque extrinsics against ethereum transactions. | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,7 +124,7 @@ where | |
|
||
pub fn account_storage(&self, at: B::Hash, address: Address, index: U256) -> Option<H256> { | ||
let tmp: &mut [u8; 32] = &mut [0; 32]; | ||
index.to_big_endian(tmp); | ||
index.write_as_big_endian(tmp); | ||
Comment on lines
126
to
+127
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of doing this, you can remove all these and update LINE 131: - key.extend(blake2_128_extend(tmp));
+ key.extend(blake2_128_extend(&index.to_big_endian())); |
||
|
||
let mut key: Vec<u8> = storage_prefix_build(PALLET_EVM, EVM_ACCOUNT_STORAGES); | ||
key.extend(blake2_128_extend(address.as_bytes())); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.