-
Notifications
You must be signed in to change notification settings - Fork 335
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
Pre v0.6 dependency updates #215
Conversation
This reverts commit 15c6218. The change this was meant to addressed isn't introduced in Cumulus until commit b5f6580.
node/parachain/src/command.rs
Outdated
sc_cli::init_logger(InitLoggerParams { | ||
tracing_receiver: sc_tracing::TracingReceiver::Log, | ||
..Default::default() | ||
})?; | ||
*/ | ||
|
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.
Need to properly fix this (and same issue 20 lines lower)
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.
runtime/src/lib.rs
Outdated
@@ -257,11 +257,11 @@ pub const WEIGHT_PER_GAS: u64 = WEIGHT_PER_SECOND / GAS_PER_SECOND; | |||
pub struct MoonbeamGasWeightMapping; | |||
|
|||
impl pallet_evm::GasWeightMapping for MoonbeamGasWeightMapping { | |||
fn gas_to_weight(gas: usize) -> Weight { | |||
fn gas_to_weight(gas: u64) -> Weight { | |||
Weight::try_from((gas as u64).saturating_mul(WEIGHT_PER_GAS)).unwrap_or(Weight::MAX) |
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.
Yeah finally a correct type for gas.
You can remove the as 64
here and maybe most of the rest too as both the Weight and the gas are 64 I think
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 kept u32::MAX as u64
in hopes of being consistent with our previous fallback. Is this ever useful, anyway, and would u64::MAX somehow be better? (or were you merely suggesting that 'as u64' was redundant?)
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.
Weight::try_from((gas as u64).saturating_mul(WEIGHT_PER_GAS)).unwrap_or(Weight::MAX) | |
gas.saturating_mul(WEIGHT_PER_GAS) |
Does this do the same thing? I think so.
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.
Good work.
Left few comments
Co-authored-by: Joshy Orndorff <JoshOrndorff@users.noreply.github.com>
Would be great to have frontier's 52cfbc4e88ad5c36db68891f20a6540613b81141 on this iteration, as it solves some The Graph requirements and we can remove the skipped test at 7890e51. |
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.
Looks awesome! Made a few little comments.
Feedback on the Frontier part:
- I like the branch name
v0.6-moonbeam
- Thanks for de-duping
parity-scale-codec
- The commit history is so nice and clean. I like the idea of keeping all the changes that we made to stock frontier right at the tip.
- I don't think 2246428858 is necessary.
@tgmichel could you take a look at https://github.com/purestake/frontier/commits/v0.6-moonbeam and confirm it has all the important stuff?nvm, you just did :)
node/parachain/src/command.rs
Outdated
sc_cli::init_logger(InitLoggerParams { | ||
tracing_receiver: sc_tracing::TracingReceiver::Log, | ||
..Default::default() | ||
})?; | ||
*/ | ||
|
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.
runtime/src/lib.rs
Outdated
@@ -257,11 +257,11 @@ pub const WEIGHT_PER_GAS: u64 = WEIGHT_PER_SECOND / GAS_PER_SECOND; | |||
pub struct MoonbeamGasWeightMapping; | |||
|
|||
impl pallet_evm::GasWeightMapping for MoonbeamGasWeightMapping { | |||
fn gas_to_weight(gas: usize) -> Weight { | |||
fn gas_to_weight(gas: u64) -> Weight { | |||
Weight::try_from((gas as u64).saturating_mul(WEIGHT_PER_GAS)).unwrap_or(Weight::MAX) |
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.
Weight::try_from((gas as u64).saturating_mul(WEIGHT_PER_GAS)).unwrap_or(Weight::MAX) | |
gas.saturating_mul(WEIGHT_PER_GAS) |
Does this do the same thing? I think so.
fn weight_to_gas(weight: Weight) -> usize { | ||
usize::try_from(weight.wrapping_div(WEIGHT_PER_GAS)).unwrap_or(usize::MAX) | ||
fn weight_to_gas(weight: Weight) -> u64 { | ||
u64::try_from(weight.wrapping_div(WEIGHT_PER_GAS)).unwrap_or(u32::MAX as u64) |
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.
u64::try_from(weight.wrapping_div(WEIGHT_PER_GAS)).unwrap_or(u32::MAX as u64) | |
weight.wrapping_div(WEIGHT_PER_GAS) |
Both input values are u64
, so the result will certainly be a u64
. The try_from
cannot possibly fail.
We are missing stuff related to the new We need to extend the rpc server: Update the service, for example: And setup the maintenance task: @notlesh I can do this in this same branch if you want. |
Also we want to include the tests for the |
…nto notlesh-pre-v0.6-dependency-updates
expect(context.polkadotApi.events.ethereum.Executed.is(events[2])).to.be.true; | ||
expect(context.polkadotApi.events.system.ExtrinsicSuccess.is(events[3])).to.be.true; | ||
// TODO: what event was inserted here? | ||
expect(context.polkadotApi.events.ethereum.Executed.is(events[3])).to.be.true; |
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.
TODO
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.
@joelamouche Is this obvious to you, or do you have some documentation handy that you could share?
/// Given the 500ms Weight, from which 75% only are used for transactions, | ||
/// the total EVM execution gas limit is: GAS_PER_SECOND * 0.500 * 0.75 => 6_000_000. | ||
pub const GAS_PER_SECOND: u64 = 16_000_000; | ||
/// Given the 500ms Weight, from which 65% only are used for transactions, |
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.
@notlesh This was correct before.
A block has 75% dedicated to tx.
65% is for the max of a single transaction
What does it do?
Updates frontier, substrate, cumulus, polkadot.
This updates:
6438d328b8ac09f43d19df65a2cf8e31a524d78f
71a528e822af63b96bdb03efac9b4927fb11a25e
93b231e79f5b4e551c34234e89fa4a2e5e9c1510
v0.6-moonbeam
(22464288585eb23c04036ef1afa5d1d7794fa378
) https://github.com/PureStake/frontier/commits/v0.6-moonbeamThis PR should be in good shape now, but it depends on some upstream PRs:
ethereum
PR needs to be merged and needs a version bump itself: Bump parity-scale-codec and ethereum-types versions rust-ethereum/ethereum#8evm
PR needs to be updated to point to the updatedethereum
, then get a version bump: Bump parity-scale-codec and primitive-types versions rust-ethereum/evm#10ethereum
andevm
versionsAlso: