Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
5d18960
Add read functionality to blobs archiving (#9318)
StefanBratanov Apr 9, 2025
2477b9a
Schedule Gnosis Pectra hard-fork (#9340)
StefanBratanov Apr 10, 2025
6510fb3
Updated ref tests v1.5.0-beta.5 (#9341)
lucassaldanha Apr 10, 2025
023fa8a
Created Fulu skeleton (#9325)
lucassaldanha Apr 10, 2025
fff2385
Made checkpoint-state-url and initial-state mutually exclusive (#9342)
rolfyone Apr 10, 2025
bbf12b2
partial 3rd party updates and errorprone updates (#9351)
rolfyone Apr 14, 2025
ddca83b
Make builder timeouts only for the HTTP call (#9353)
StefanBratanov Apr 14, 2025
4d354eb
more 3rd party updates (#9355)
rolfyone Apr 15, 2025
b706f5b
KZG updates from das branch (#9335)
lucassaldanha Apr 15, 2025
f8389db
Avoid combining validators by aggregating committee when using DVT (#…
lucassaldanha Apr 16, 2025
e3259c5
builder json format, make media type more compatible (#9360)
tbenr Apr 16, 2025
5a695c7
refactored expected withdrawals and added test cases (#9361)
rolfyone Apr 16, 2025
4f92f4c
Use `URI.create(...).toURL()` removing URL constructor deprecation (#…
tbenr Apr 17, 2025
c2442a4
clear-changelog (#9366)
tbenr Apr 23, 2025
e4adc71
New infra stream module (#9362)
lucassaldanha Apr 27, 2025
5dad0ed
feat: Add support for reading static peers from file (#9328)
crStiv Apr 28, 2025
fe4a939
Start cleaning up `api/schema` (#9376)
rolfyone Apr 28, 2025
f93c8ff
cleanup the rest of api/schema (#9377)
rolfyone Apr 28, 2025
9af5370
Added KZG computeCells method (#9375)
lucassaldanha Apr 28, 2025
178a6bd
Fulu Schemas (ssz + datastructures) - including fulu ssz ref tests (#…
lucassaldanha Apr 28, 2025
dd40b5c
Added context to the sync committee duties error (#9380)
rolfyone May 1, 2025
4391e87
Returning custody_group_count on node/identity Beacon API (#9381)
lucassaldanha May 5, 2025
d3ee2d4
may 3rd party updates (#9388)
rolfyone May 5, 2025
6e54398
Added snakeyaml to allow more complicated config reading (#9390)
rolfyone May 6, 2025
7005739
Add FULU to the Spec Factory (#9373)
mehdi-aouadi May 6, 2025
5150373
Improve attestation bits aggregator electra (#9393)
tbenr May 7, 2025
10d8263
added a DeserializableConfigTypeDefinition (#9396)
rolfyone May 8, 2025
2fd5eb6
Updating ref test to 1.5.0 stable (#9398)
lucassaldanha May 8, 2025
f13b314
uniforms the AggregatingAttestationPool interface (#9401)
tbenr May 8, 2025
9d26d07
Avoids potential mutability of the result of getCommitteeBits (#9402)
tbenr May 8, 2025
55024d7
Adding DataColumnsByRootIdentifier container (#9399)
lucassaldanha May 8, 2025
989b142
Added an info message for the highest milestone (#9405)
rolfyone May 9, 2025
d2b9690
Introduce `PooledAttestation` and `PooledAttestationWithData` (#9407)
tbenr May 11, 2025
3a0e5e6
Improve jdk 24 support and add docker-jdk24 (#9410)
tbenr May 11, 2025
1b38c15
rename AttestationBitsAggregator to AttestationBits (#9412)
tbenr May 11, 2025
cee9f3d
Introduce aggregating pool interface (#9414)
tbenr May 12, 2025
92fbcb6
[docker-jdk24] SIGHUP handler fix (#9413)
tbenr May 12, 2025
46bed55
Optionally include validator indices in `PooledAttestation` (#9418)
tbenr May 13, 2025
206c265
Improve committeesSize retrieval in `AggregatingAttestationPool` (#9419)
tbenr May 14, 2025
03b0df7
Batch attestation duty scheduling for an epoch (#9374)
StefanBratanov May 14, 2025
c443b37
Updated MiscHelpersFulu + Added Gossip Logger (#9422)
lucassaldanha May 15, 2025
8eb9a03
Gossip DAS related changes (#9423)
lucassaldanha May 15, 2025
d46dd18
added bpo parsing to configuration (#9406)
rolfyone May 15, 2025
1109fd4
BPO - remove max blobs from fulu spec (#9427)
rolfyone May 18, 2025
3254e4b
Introduces `RewardBasedAttestationSorter` (#9428)
tbenr May 19, 2025
a297d79
DAS storage changes (#9432)
lucassaldanha May 20, 2025
5b9a712
Added config defaulting to the Config loader (#9439)
rolfyone May 20, 2025
0f7c19f
Introduce `AttestationMatchingGroupV2` (#9438)
tbenr May 20, 2025
67c23a4
Introduce `AggregatingAttestationPoolV2` (#9445)
tbenr May 20, 2025
3dc3ae0
Introduce `AggregatingAttestationPoolProfiler` implementations (#9447)
tbenr May 21, 2025
6429f09
PeerDAS RPC related changes (#9444)
lucassaldanha May 21, 2025
c7f9a3c
Added a development flag to enable strict config loading (#9449)
rolfyone May 21, 2025
a24b5e4
Updating reference tests to 1.6.0-alpha.0 (#9450)
lucassaldanha May 21, 2025
4c26da9
Refactoring networking ATs
lucassaldanha May 21, 2025
fdc1b8f
Add peer via api (#9431)
gfukushima May 21, 2025
0d7f50c
`AggregatingAttestationPool` new CLI params (#9452)
tbenr May 21, 2025
700257a
getBits method names clearer (#9453)
tbenr May 21, 2025
99df3fd
Validate electra attestationData index received by BN (#9430)
tbenr May 21, 2025
ef4e2f2
Merge branch 'master' into merge-master
zilm13 May 21, 2025
e1d3545
fix integration test
zilm13 May 21, 2025
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 @@ -17,5 +17,6 @@
- Added jdk 24 docker image build.
- Improved performance when scheduling attestations in the beginning of the epoch for a large number of validators.
- Improved configuration loading to use builtin configurations to default any fields we need that were missing from a passed in configuration.
- Add `/teku/v1/admin/add_peer` endpoint to allow adding static peers via the REST API.

### Bug Fixes
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public GenesisGenerator genesisExecutionPayloadHeaderSource(
}

public InitialStateData generate() {
final Spec spec = SpecFactory.create(network, specConfigModifier);
final Spec spec = SpecFactory.create(network, false, specConfigModifier);
final GenesisStateBuilder genesisBuilder = new GenesisStateBuilder();
genesisBuilder
.spec(spec)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ private TekuBeaconNode(
.orElseThrow()
.getKey()
.getAbsolutePath();
this.spec = SpecFactory.create(tmpConfigFilePath, config.getSpecConfigModifier());
this.spec = SpecFactory.create(tmpConfigFilePath, true, config.getSpecConfigModifier());
} else {
this.spec = SpecFactory.create(config.getNetworkName(), config.getSpecConfigModifier());
this.spec = SpecFactory.create(config.getNetworkName(), true, config.getSpecConfigModifier());
}
if (config.getConfigMap().containsKey("validator-api-enabled")) {
container.addExposedPort(VALIDATOR_API_PORT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ public SafeFuture<Void> requestDataColumnSidecarsByRange(
final UInt64 count,
final List<UInt64> columns,
final RpcResponseListener<DataColumnSidecar> listener) {
if (dataColumnSidecarsRateTracker.approveObjectsRequest(count.longValue()).isPresent()) {
final long maxColumnsSidecarsCount = count.times(columns.size()).longValue();
if (dataColumnSidecarsRateTracker.approveObjectsRequest(maxColumnsSidecarsCount).isPresent()) {
LOG.debug("Sending request for {} data column sidecars on {} columns", count, columns.size());
return delegate.requestDataColumnSidecarsByRange(startSlot, count, columns, listener);
} else {
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ allprojects {
}

def nightly = System.getenv("NIGHTLY") != null
def refTestVersion = nightly ? "nightly" : "v1.5.0"
def refTestVersion = nightly ? "nightly" : "v1.6.0-alpha.0"
def blsRefTestVersion = 'v0.1.2'
def slashingProtectionInterchangeRefTestVersion = 'v5.3.0'
def refTestBaseUrl = 'https://github.com/ethereum/consensus-spec-tests/releases/download'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"post" : {
"tags" : [ "Teku" ],
"operationId" : "AddPeer",
"summary" : "Add a static peer to the node",
"description" : "Add a static peer to the node passing a multiaddress.",
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"type" : "string",
"description" : "Multiaddress of the peer to add"
}
}
}
},
"responses" : {
"200" : {
"description" : "Peer added successfully",
"content" : { }
},
"400" : {
"description" : "Invalid peer address",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/HttpErrorResponse"
}
}
}
},
"500" : {
"description" : "Internal server error",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/HttpErrorResponse"
}
}
}
}
}
}
}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import tech.pegasys.teku.beaconrestapi.addon.DenebRestApiBuilderAddon;
import tech.pegasys.teku.beaconrestapi.addon.FuluRestApiBuilderAddon;
import tech.pegasys.teku.beaconrestapi.addon.LightClientRestApiBuilderAddon;
import tech.pegasys.teku.beaconrestapi.handlers.tekuv1.admin.AddPeer;
import tech.pegasys.teku.beaconrestapi.handlers.tekuv1.admin.Liveness;
import tech.pegasys.teku.beaconrestapi.handlers.tekuv1.admin.PutLogLevel;
import tech.pegasys.teku.beaconrestapi.handlers.tekuv1.admin.Readiness;
Expand Down Expand Up @@ -323,7 +324,8 @@ private static RestApi create(
.endpoint(new GetEth1VotingSummary(dataProvider, eth1DataProvider))
.endpoint(new GetGlobalValidatorInclusion(dataProvider))
.endpoint(new GetFinalizedStateSlotBefore(dataProvider))
.endpoint(new GetValidatorInclusion(dataProvider));
.endpoint(new GetValidatorInclusion(dataProvider))
.endpoint(new AddPeer(dataProvider));

builder = applyAddons(builder, config, spec, dataProvider, schemaCache);
return builder.build();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/*
* Copyright Consensys Software Inc., 2025
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/

package tech.pegasys.teku.beaconrestapi.handlers.tekuv1.admin;

import static tech.pegasys.teku.infrastructure.http.HttpStatusCodes.SC_BAD_REQUEST;
import static tech.pegasys.teku.infrastructure.http.HttpStatusCodes.SC_INTERNAL_SERVER_ERROR;
import static tech.pegasys.teku.infrastructure.http.HttpStatusCodes.SC_OK;
import static tech.pegasys.teku.infrastructure.http.RestApiConstants.TAG_TEKU;
import static tech.pegasys.teku.infrastructure.json.types.CoreTypes.STRING_TYPE;

import com.fasterxml.jackson.core.JsonProcessingException;
import java.util.Optional;
import tech.pegasys.teku.api.DataProvider;
import tech.pegasys.teku.api.NetworkDataProvider;
import tech.pegasys.teku.infrastructure.restapi.endpoints.EndpointMetadata;
import tech.pegasys.teku.infrastructure.restapi.endpoints.RestApiEndpoint;
import tech.pegasys.teku.infrastructure.restapi.endpoints.RestApiRequest;
import tech.pegasys.teku.networking.p2p.discovery.DiscoveryNetwork;

public class AddPeer extends RestApiEndpoint {

public static final String ROUTE = "/teku/v1/admin/add_peer";
final NetworkDataProvider networkDataProvider;

public AddPeer(final DataProvider dataProvider) {
this(dataProvider.getNetworkDataProvider());
}

AddPeer(final NetworkDataProvider networkDataProvider) {
super(
EndpointMetadata.post(ROUTE)
.operationId("AddPeer")
.summary("Add a static peer to the node")
.description("Add a static peer to the node passing a multiaddress.")
.tags(TAG_TEKU)
.requestBodyType(STRING_TYPE.withDescription("Multiaddress of the peer to add"))
.response(SC_OK, "Peer added successfully")
.withBadRequestResponse(Optional.of("Invalid peer address"))
.withInternalErrorResponse()
.build());
this.networkDataProvider = networkDataProvider;
}

@Override
public void handleRequest(final RestApiRequest request) throws JsonProcessingException {
try {

final String peerAddress = request.getRequestBody();
if (peerAddress.isEmpty()) {
request.respondWithCode(SC_OK);
return;
}

final DiscoveryNetwork<?> discoveryNetwork =
networkDataProvider
.getDiscoveryNetwork()
.orElseThrow(() -> new IllegalStateException("Discovery network not available"));

discoveryNetwork.addStaticPeer(peerAddress);
request.respondWithCode(SC_OK);
} catch (final IllegalArgumentException e) {
request.respondError(SC_BAD_REQUEST, e.getMessage());
} catch (final IllegalStateException e) {
request.respondError(SC_INTERNAL_SERVER_ERROR, e.getMessage());
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/*
* Copyright Consensys Software Inc., 2025
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/

package tech.pegasys.teku.beaconrestapi.handlers.tekuv1.admin;

import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import static tech.pegasys.teku.infrastructure.http.HttpStatusCodes.SC_BAD_REQUEST;
import static tech.pegasys.teku.infrastructure.http.HttpStatusCodes.SC_INTERNAL_SERVER_ERROR;
import static tech.pegasys.teku.infrastructure.http.HttpStatusCodes.SC_OK;
import static tech.pegasys.teku.infrastructure.restapi.MetadataTestUtil.verifyMetadataEmptyResponse;
import static tech.pegasys.teku.infrastructure.restapi.MetadataTestUtil.verifyMetadataErrorResponse;

import com.fasterxml.jackson.core.JsonProcessingException;
import java.util.Optional;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import tech.pegasys.teku.beaconrestapi.AbstractMigratedBeaconHandlerTest;
import tech.pegasys.teku.networking.p2p.discovery.DiscoveryNetwork;

class AddPeerTest extends AbstractMigratedBeaconHandlerTest {

private final DiscoveryNetwork<?> discoveryNetwork = mock(DiscoveryNetwork.class);

@BeforeEach
public void setup() {
setHandler(new AddPeer(network));
}

@Test
void metadata_shouldHandle200() {
verifyMetadataEmptyResponse(handler, SC_OK);
}

@Test
void metadata_shouldHandle400() throws JsonProcessingException {
verifyMetadataErrorResponse(handler, SC_BAD_REQUEST);
}

@Test
void metadata_shouldHandle500() throws JsonProcessingException {
verifyMetadataErrorResponse(handler, SC_INTERNAL_SERVER_ERROR);
}

@Test
public void shouldReturnOkWhenAValidListIsProvided() throws Exception {
final String peerAddress = "/ip4/someIP/udp/9001/p2p/somePeerId";
request.setRequestBody(peerAddress);
when(network.getDiscoveryNetwork()).thenReturn(Optional.of(discoveryNetwork));
handler.handleRequest(request);
assertThat(request.getResponseCode()).isEqualTo(SC_OK);
}

@Test
public void shouldReturnOkWhenRequestBodyIsEmpty() throws Exception {
final String peerAddress = "";
request.setRequestBody(peerAddress);
when(network.getDiscoveryNetwork()).thenReturn(Optional.of(discoveryNetwork));
handler.handleRequest(request);
assertThat(request.getResponseCode()).isEqualTo(SC_OK);
}

@Test
public void shouldReturnBadRequestIfInvalidPeerAddress() throws Exception {
final String peerAddress = "invalid-peer-address";
request.setRequestBody(peerAddress);
when(network.getDiscoveryNetwork()).thenReturn(Optional.of(discoveryNetwork));
doThrow(new IllegalArgumentException("Invalid peer address"))
.when(discoveryNetwork)
.addStaticPeer(peerAddress);
handler.handleRequest(request);
assertThat(request.getResponseCode()).isEqualTo(SC_BAD_REQUEST);
}

@Test
public void shouldReturnInternalErrorWhenDiscoveryNetworkNotAvailable() throws Exception {
final String peerAddress = "/ip4/someIP/udp/9001/p2p/somePeerId";
request.setRequestBody(peerAddress);
when(network.getDiscoveryNetwork()).thenReturn(Optional.empty());
handler.handleRequest(request);
assertThat(request.getResponseCode()).isEqualTo(SC_INTERNAL_SERVER_ERROR);
}
}
Loading