Reorganization of OTF patches on top of the correct branch#60
Open
l0r1s wants to merge 13 commits intofrontier-stable2506-otf-patchesfrom
Open
Reorganization of OTF patches on top of the correct branch#60l0r1s wants to merge 13 commits intofrontier-stable2506-otf-patchesfrom
l0r1s wants to merge 13 commits intofrontier-stable2506-otf-patchesfrom
Conversation
- Introduced `fc-aura` and `fc-babe` packages for Aura and Babe consensus mechanisms. - Updated `Cargo.toml` to include new dependencies and features for both consensus providers. - Implemented `AuraConsensusDataProvider` and `BabeConsensusDataProvider` with necessary methods for digest creation. - Adjusted existing RPC configurations to accommodate new consensus data providers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reorganize OTF patches on Frontier
Motivation
Previously, our OTF-specific patches lived on
master, interleaved with upstream Frontier commits. This made it hard to tell what was ours vs upstream, and upgrading to a new Frontier release meant cherry-picking our changes out of a mixed history.This branch applies our patches as clean, isolated commits on top of an unmodified upstream
stable2506tag. Each future Frontier upgrade gets its own version branch with the patches reapplied, making the OTF delta explicit and rebases straightforward.Patches
1. Balance conversion between Substrate and EVM
Substrate uses 9-decimal balances, EVM expects 18 decimals. This patch introduces a
BalanceConvertertrait withinto_evm_balanceandinto_substrate_balancemethods, along withEvmBalanceandSubstrateBalancewrapper types. The conversion is applied at every boundary:account_basic(reporting balances to RPC),withdraw_fee/correct_and_deposit_fee(gas fee lifecycle), andtransfer(EVM value transfers). TheOnChargeEVMTransactiontrait signatures change from rawU256toEvmBalanceto enforce type safety. A()identity implementation is provided as the default for test environments, and the template runtime usesSubtensorEvmBalanceConverterwith a 1e9 factor.2. Contract creation whitelisting
Adds
WhitelistedCreatorsandDisableWhitelistCheckstorage items topallet-evm, along withset_whitelistanddisable_whitelistextrinsics (sudo-gated, call_index 4 and 5). The whitelist is enforced in the runner'svalidate()method for contract creation (target.is_none()). When the check is enabled and the source address is not in the whitelist, the transaction fails withNotAllowed.DisableWhitelistCheckis exposed in the EVM genesis config so dev chains can disable it at genesis.3. Uniform transaction priority (MEV prevention)
Disables priority fee-based transaction ordering to prevent MEV. In
stack.rs,max_priority_fee_per_gasis forced toNoneregardless of what the transaction specifies. Inethereum/lib.rs, the transaction pool priority is hardcoded to1for all EVM transactions instead of being computed from gas price or tip. The tip component is always zero; base fees are burned as usual.4. Aura and Babe consensus data providers
Adds
client/auraandclient/babecrates that implement consensus data providers needed by the OTF runtime. These provide slot-based block authoring support for frontier's block import pipeline.5. Precompile code metadata fix
Modifies
account_code_metadatato returnsize: 1and the empty code hash for precompile addresses. This allows contract calls to precompiles (e.g.IPrecompile.call) to succeed by bypassing the code size check that would otherwise reject calls to addresses with no deployed code.