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

[PAN-3065] Disable Istanbul block #1849

Merged
merged 2 commits into from
Aug 14, 2019
Merged
Show file tree
Hide file tree
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 @@ -22,8 +22,13 @@

import com.fasterxml.jackson.databind.node.ObjectNode;
import com.google.common.collect.ImmutableMap;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public class JsonGenesisConfigOptions implements GenesisConfigOptions {

private final Logger LOG = LogManager.getLogger();

private static final String ETHASH_CONFIG_KEY = "ethash";
private static final String IBFT_LEGACY_CONFIG_KEY = "ibft";
private static final String IBFT2_CONFIG_KEY = "ibft2";
Expand Down Expand Up @@ -140,9 +145,13 @@ public OptionalLong getConstantinopleFixBlockNumber() {
return getOptionalLong("constantinoplefixblock");
}

// Disabled until Istanbul is settled
@Override
public OptionalLong getIstanbulBlockNumber() {
return getOptionalLong("istanbulblock");
if (configRoot.has("istanbulblock")) {
LOG.warn("IstanbulBlock was requested but configuration is not enabled");
}
return OptionalLong.empty();
}

@Override
Expand Down Expand Up @@ -188,7 +197,8 @@ public Map<String, Object> asMap() {
getByzantiumBlockNumber().ifPresent(l -> builder.put("byzantiumBlock", l));
getConstantinopleBlockNumber().ifPresent(l -> builder.put("constantinopleBlock", l));
getConstantinopleFixBlockNumber().ifPresent(l -> builder.put("constantinopleFixBlock", l));
getIstanbulBlockNumber().ifPresent(l -> builder.put("istanbulBlock", l));
// Disabled until Istanbul is settled
// getIstanbulBlockNumber().ifPresent(l -> builder.put("istanbulBlock", l));
getContractSizeLimit().ifPresent(l -> builder.put("contractSizeLimit", l));
getEvmStackSize().ifPresent(l -> builder.put("evmstacksize", l));
if (isClique()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ public void shouldGetConstantinopleFixBlockNumber() {
@Test
public void shouldGetIstanbulBlockNumber() {
final GenesisConfigOptions config = fromConfigOptions(singletonMap("istanbulBlock", 1000));
assertThat(config.getIstanbulBlockNumber()).hasValue(1000);
// Disabled until Istanbul is settled
assertThat(config.getIstanbulBlockNumber()).isEmpty();
}

@Test
Expand Down