Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix config provider to fix spec config api #8919

Merged
merged 3 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ public ConfigProvider(final Spec spec) {
}

public Map<String, String> 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) {
Expand Down
Loading