3

I was able to successfully build my own Ethereum-compatible Substrate by basically following the Substrate Dev Frontier Workshop tutorial ( which uses SputnikVM as the underlying EVM engine, as per the Frontier Evm Documentation ).

I am aware of the fact that Ethereum is behaving more or less differently after each for, like for example, a decrease or increase of Gas costs of various EVM OPCODEs after some forks.

That being said, what kind of Ethereum is this Sputnik-based client exactly? Is this client similar to Berlin, Istanbul or similar to something older like Homestead or Byzantium? Should I use the latest solc compiler like 0.8.6+commit.11564f7e or should I use something older like 0.6.0+commit.26b70077 or 0.4.0+commit.acd334c9 ?

I would like to know because I need to document exactly what the gas cost of every contract deployment or method call or, prevent incompatibility.

Andy B.
  • 181
  • 2
  • 9
  • I'd assumed it was tracking whatever ethereum is currently doing (possibly with a slight lag) so maybe any london adjustments are not yet baked in. It's a good question! – Squirrel Aug 05 '21 at 19:33

1 Answers1

0

The Sputnik evm implementation contains different flavors of EvmConfig for you to choose from.

If you look into the source code, you will find four of them:

impl Config {
    /// Frontier hard fork configuration.
    pub const fn frontier() -> Config { ... }

    /// Istanbul hard fork configuration.
    pub const fn istanbul() -> Config { ... }

    /// Berlin hard fork configuration.
    pub const fn berlin() -> Config { ... }

    /// london hard fork configuration.
    pub const fn london() -> Config { ... }
}

According to frontier's pallet-evm documentation

The gas configurations are configurable. Right now, a pre-defined London hard fork configuration option is provided.

Thus currently they are using the london hard fork configuration, which is confirmed by this commit, which shows they switched the default config from istanbul to london:

...
        /// EVM config used in the module.
        fn config() -> &'static EvmConfig {
-           &ISTANBUL_CONFIG
+           &LONDON_CONFIG
        }
    }

@@ -571,7 +571,7 @@ impl GasWeightMapping for () {
    }
}

-static ISTANBUL_CONFIG: EvmConfig = EvmConfig::istanbul();
+static LONDON_CONFIG: EvmConfig = EvmConfig::london();
...

If you want detailed parameters of each hard fork, be sure to check here

btwiuse
  • 2,585
  • 1
  • 23
  • 31