diff --git a/CHANGELOG.md b/CHANGELOG.md index f9bffda3d31..6558b740bfb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,3 +11,4 @@ ### Additions and Improvements ### Bug Fixes +- Fixed an issue with the `/eth/v1/config/spec` API not returning all previously included configuration parameters. \ No newline at end of file diff --git a/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v1/config/GetSpec.java b/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v1/config/GetSpec.java index 4dbc4ce083c..f50128e6279 100644 --- a/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v1/config/GetSpec.java +++ b/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v1/config/GetSpec.java @@ -53,7 +53,7 @@ public GetSpec(final DataProvider dataProvider) { @Override public void handleRequest(final RestApiRequest request) throws JsonProcessingException { try { - final SpecConfigData responseContext = new SpecConfigData(configProvider.getGenesisSpec()); + final SpecConfigData responseContext = new SpecConfigData(configProvider.getSpecConfig()); request.respondOk(responseContext.getConfigMap()); } catch (JsonProcessingException e) { String message = diff --git a/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/handlers/v1/config/GetSpecTest.java b/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/handlers/v1/config/GetSpecTest.java index b3955ab293c..e5562790e50 100644 --- a/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/handlers/v1/config/GetSpecTest.java +++ b/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/handlers/v1/config/GetSpecTest.java @@ -28,7 +28,7 @@ class GetSpecTest extends AbstractMigratedBeaconHandlerTest { private final ConfigProvider configProvider = new ConfigProvider(spec); - private final SpecConfigData response = new SpecConfigData(configProvider.getGenesisSpecConfig()); + private final SpecConfigData response = new SpecConfigData(configProvider.getSpecConfig()); @BeforeEach void setUp() { diff --git a/data/provider/src/main/java/tech/pegasys/teku/api/ConfigProvider.java b/data/provider/src/main/java/tech/pegasys/teku/api/ConfigProvider.java index 5770ec16ca9..2f0688ba368 100644 --- a/data/provider/src/main/java/tech/pegasys/teku/api/ConfigProvider.java +++ b/data/provider/src/main/java/tech/pegasys/teku/api/ConfigProvider.java @@ -30,12 +30,13 @@ public ConfigProvider(final Spec spec) { } public Map getConfig() { - final SpecConfigData configuration = new SpecConfigData(spec.getGenesisSpecConfig()); + final SpecConfigData configuration = + new SpecConfigData(spec.getSpecConfigAndParent().specConfig()); return configuration.getConfigMap(); } - public SpecConfig getGenesisSpec() { - return spec.atEpoch(UInt64.ZERO).getConfig(); + public SpecConfig getSpecConfig() { + return spec.getSpecConfigAndParent().specConfig(); } public static String formatValue(final Object v) {