Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

[PAN-2903] no chain ID means Chain ID opcode returns 0 #1785

Merged
merged 2 commits into from
Jul 30, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
*/
package tech.pegasys.pantheon.ethereum.mainnet;

import static com.google.common.base.Preconditions.checkArgument;
import static tech.pegasys.pantheon.ethereum.vm.MessageFrame.DEFAULT_MAX_STACK_SIZE;

import tech.pegasys.pantheon.ethereum.MainnetBlockValidator;
Expand Down Expand Up @@ -292,14 +291,15 @@ public static ProtocolSpecBuilder<Void> istanbulDefinition(
final OptionalInt configContractSizeLimit,
final OptionalInt configStackSizeLimit,
final boolean enableRevertReason) {
checkArgument(chainId.isPresent(), "Istanbul requires the use of chainId");
final int contractSizeLimit =
configContractSizeLimit.orElse(SPURIOUS_DRAGON_CONTRACT_SIZE_LIMIT);
final int stackSizeLimit = configStackSizeLimit.orElse(DEFAULT_MAX_STACK_SIZE);
return constantinopleFixDefinition(
chainId, configContractSizeLimit, configStackSizeLimit, enableRevertReason)
.gasCalculator(IstanbulGasCalculator::new)
.evmBuilder(gasCalculator -> MainnetEvmRegistries.istanbul(gasCalculator, chainId.get()))
.evmBuilder(
gasCalculator ->
MainnetEvmRegistries.istanbul(gasCalculator, chainId.orElse(BigInteger.ZERO)))
.precompileContractRegistryBuilder(MainnetPrecompiledContractRegistries::istanbul)
.transactionProcessorBuilder(
(gasCalculator,
Expand Down