-
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?
Conversation
Now, it's blocked as this rust-ethereum/evm#305 |
b9954f4
to
5ae383a
Compare
Please merge master and fix those tests. Thanks! |
I am struggling with integration testing and I estimate it will take me some time to complete the work. |
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.
I leave comments on parts where Deref
is not necessarily required. As for the SelfContained
, I haven’t been able to review it in depth yet, but I will take the time to revisit it.
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
.map(|in_pool_tx| in_pool_tx.data().deref().clone()) | |
.map(|in_pool_tx| in_pool_tx.data().as_ref().clone()) |
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
use std::{ops::Deref, sync::Arc}; | |
use std::sync::Arc; |
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
.map(|(_hash, extrinsic)| extrinsic.deref().clone()) | |
.map(|(_hash, extrinsic)| extrinsic.as_ref().clone()) |
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
ops::Deref, |
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
.map(|in_pool_tx| in_pool_tx.data().deref().clone()) | |
.map(|in_pool_tx| in_pool_tx.data().as_ref().clone()) |
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
use std::{marker::PhantomData, ops::Deref, sync::Arc}; | |
use std::{marker::PhantomData, sync::Arc}; |
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
.map(|in_pool_tx| in_pool_tx.data().deref().clone()) | |
.map(|in_pool_tx| in_pool_tx.data().as_ref().clone()) |
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
.map(|(_, extrinsic)| extrinsic.deref().clone()) | |
.map(|(_, extrinsic)| extrinsic.as_ref().clone()) |
let tmp: &mut [u8; 32] = &mut [0; 32]; | ||
index.to_big_endian(tmp); | ||
index.write_as_big_endian(tmp); |
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.
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()));
@@ -282,8 +282,7 @@ impl Precompile for Bn128Pairing { | |||
} | |||
}; | |||
|
|||
let mut buf = [0u8; 32]; | |||
ret_val.to_big_endian(&mut buf); | |||
let buf = ret_val.to_big_endian(); |
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.
What about updating LINE 290 instead of assigning a new buf here?
Ok(PrecompileOutput {
exit_status: ExitSucceed::Returned,
- output: buf.to_vec(),
+ output: ret_val.to_big_endian().to_vec(),
})
The main reason for the upgrade is to try to resolve the memory leak issue in
polkadot-sdk
stable2409
, but this PR has not been backported tostable2409
.