Skip to content
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
6 changes: 3 additions & 3 deletions patches/consensys/teku/master.patch
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
diff --git a/build.gradle b/build.gradle
index ba3f2a7..d2265ee 100644
index ba3f2a7..b0d14e1 100644
--- a/build.gradle
+++ b/build.gradle
@@ -928,6 +928,28 @@ tasks.register('localDocker') {
from file("${projectDir}/docker/${dockerJdkVariants[0]}/Dockerfile")
into(dockerBuildDir)
}
+ // Download and copy xatu native library
+ def xatuVersion = "v0.0.6"
+ def xatuVersion = "v0.0.7"
+ def libxatuFile = file("${projectDir}/libxatu.so")
+ if (!libxatuFile.exists()) {
+ def platform = "linux"
Expand Down Expand Up @@ -36,7 +36,7 @@ index ba3f2a7..d2265ee 100644
def includeCommitHashInDockerTag = project.hasProperty('includeCommitHashInDockerTag') && project.property('includeCommitHashInDockerTag').toBoolean()
def commitHashTag = includeCommitHashInDockerTag ? '-' + gitCommitHashShort() : ''
+ // Download and copy xatu native library
+ def xatuVersion = "v0.0.6"
+ def xatuVersion = "v0.0.7"
+ def libxatuFile = file("${projectDir}/libxatu.so")
+ if (!libxatuFile.exists()) {
+ def platform = "linux"
Expand Down
1 change: 1 addition & 0 deletions plugins/xatu/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ dependencies {
implementation project(':infrastructure:time')
implementation project(':infrastructure:unsigned')
implementation project(':ethereum:spec')
implementation project(':ethereum:execution-types')

implementation 'net.java.dev.jna:jna'
implementation 'org.apache.logging.log4j:log4j-api'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,16 @@
import tech.pegasys.teku.infrastructure.version.VersionProvider;
import tech.pegasys.teku.spec.datastructures.blobs.DataColumnSidecar;
import tech.pegasys.teku.spec.datastructures.blobs.versions.deneb.BlobSidecar;
import tech.pegasys.teku.spec.datastructures.blobs.versions.gloas.DataColumnSidecarGloas;
import tech.pegasys.teku.spec.datastructures.blocks.SignedBeaconBlock;
import tech.pegasys.teku.spec.datastructures.epbs.versions.gloas.ExecutionPayloadBid;
import tech.pegasys.teku.spec.datastructures.epbs.versions.gloas.ExecutionPayloadEnvelope;
import tech.pegasys.teku.spec.datastructures.epbs.versions.gloas.PayloadAttestationData;
import tech.pegasys.teku.spec.datastructures.epbs.versions.gloas.PayloadAttestationMessage;
import tech.pegasys.teku.spec.datastructures.epbs.versions.gloas.ProposerPreferences;
import tech.pegasys.teku.spec.datastructures.epbs.versions.gloas.SignedExecutionPayloadBid;
import tech.pegasys.teku.spec.datastructures.epbs.versions.gloas.SignedExecutionPayloadEnvelope;
import tech.pegasys.teku.spec.datastructures.epbs.versions.gloas.SignedProposerPreferences;
import tech.pegasys.teku.spec.datastructures.operations.Attestation;
import tech.pegasys.teku.spec.datastructures.operations.SignedAggregateAndProof;

Expand Down Expand Up @@ -319,6 +328,21 @@ private Optional<ObjectNode> convertToXatuEvent(final GossipMessageAcceptedEvent
blobSidecar.getSignedBeaconBlockHeader().getMessage().getStateRoot().toHexString());
return Optional.of(eventNode);

} else if (message instanceof DataColumnSidecarGloas dataColumnSidecar) {
ObjectNode eventNode = MAPPER.createObjectNode();
eventNode.put("event_type", "DATA_COLUMN_SIDECAR_GLOAS");
long slot = dataColumnSidecar.getSlot().longValue();
eventNode.put("timestamp_ms", timestampMs);
eventNode.put("slot", slot);
eventNode.put("epoch", slot / SLOTS_PER_EPOCH);
eventNode.put("column_index", dataColumnSidecar.getIndex().longValue());
eventNode.put("message_size", messageSize);
eventNode.put("peer_id", peerId);
eventNode.put("message_id", messageId);
eventNode.put("topic", topic);
eventNode.put("block_root", dataColumnSidecar.getBeaconBlockRoot().toHexString());
return Optional.of(eventNode);

} else if (message instanceof DataColumnSidecar dataColumnSidecar) {
ObjectNode eventNode = MAPPER.createObjectNode();
eventNode.put("event_type", "DATA_COLUMN_SIDECAR");
Expand All @@ -345,6 +369,81 @@ private Optional<ObjectNode> convertToXatuEvent(final GossipMessageAcceptedEvent
eventNode.put("state_root", header.getMessage().getStateRoot().toHexString());
});
return Optional.of(eventNode);

} else if (message instanceof SignedExecutionPayloadEnvelope signedEnvelope) {
ObjectNode eventNode = MAPPER.createObjectNode();
eventNode.put("event_type", "EXECUTION_PAYLOAD_ENVELOPE");
ExecutionPayloadEnvelope envelope = signedEnvelope.getMessage();
long slot = envelope.getSlot().longValue();
eventNode.put("timestamp_ms", timestampMs);
eventNode.put("slot", slot);
eventNode.put("epoch", slot / SLOTS_PER_EPOCH);
eventNode.put("builder_index", envelope.getBuilderIndex().bigIntegerValue());
eventNode.put("message_size", messageSize);
eventNode.put("peer_id", peerId);
eventNode.put("message_id", messageId);
eventNode.put("topic", topic);
eventNode.put("beacon_block_root", envelope.getBeaconBlockRoot().toHexString());
eventNode.put("block_hash", envelope.getPayload().getBlockHash().toHexString());
eventNode.put("state_root", envelope.getPayload().getStateRoot().toHexString());
return Optional.of(eventNode);

} else if (message instanceof SignedExecutionPayloadBid signedBid) {
ObjectNode eventNode = MAPPER.createObjectNode();
eventNode.put("event_type", "EXECUTION_PAYLOAD_BID");
ExecutionPayloadBid bid = signedBid.getMessage();
long slot = bid.getSlot().longValue();
eventNode.put("timestamp_ms", timestampMs);
eventNode.put("slot", slot);
eventNode.put("epoch", slot / SLOTS_PER_EPOCH);
eventNode.put("builder_index", bid.getBuilderIndex().bigIntegerValue());
eventNode.put("value", bid.getValue().bigIntegerValue());
eventNode.put("execution_payment", bid.getExecutionPayment().bigIntegerValue());
eventNode.put("gas_limit", bid.getGasLimit().bigIntegerValue());
eventNode.put("blob_kzg_commitment_count", bid.getBlobKzgCommitments().size());
eventNode.put("message_size", messageSize);
eventNode.put("peer_id", peerId);
eventNode.put("message_id", messageId);
eventNode.put("topic", topic);
eventNode.put("block_hash", bid.getBlockHash().toHexString());
eventNode.put("parent_block_hash", bid.getParentBlockHash().toHexString());
eventNode.put("fee_recipient", bid.getFeeRecipient().getWrappedBytes().toHexString());
return Optional.of(eventNode);

} else if (message instanceof PayloadAttestationMessage payloadAttestation) {
ObjectNode eventNode = MAPPER.createObjectNode();
eventNode.put("event_type", "PAYLOAD_ATTESTATION_MESSAGE");
PayloadAttestationData data = payloadAttestation.getData();
long slot = data.getSlot().longValue();
eventNode.put("timestamp_ms", timestampMs);
eventNode.put("slot", slot);
eventNode.put("epoch", slot / SLOTS_PER_EPOCH);
eventNode.put("validator_index", payloadAttestation.getValidatorIndex().bigIntegerValue());
eventNode.put("payload_present", data.isPayloadPresent());
eventNode.put("blob_data_available", data.isBlobDataAvailable());
eventNode.put("message_size", messageSize);
eventNode.put("peer_id", peerId);
eventNode.put("message_id", messageId);
eventNode.put("topic", topic);
eventNode.put("beacon_block_root", data.getBeaconBlockRoot().toHexString());
return Optional.of(eventNode);

} else if (message instanceof SignedProposerPreferences signedPreferences) {
ObjectNode eventNode = MAPPER.createObjectNode();
eventNode.put("event_type", "PROPOSER_PREFERENCES");
ProposerPreferences preferences = signedPreferences.getMessage();
long slot = preferences.getProposalSlot().longValue();
eventNode.put("timestamp_ms", timestampMs);
eventNode.put("slot", slot);
eventNode.put("epoch", slot / SLOTS_PER_EPOCH);
eventNode.put("validator_index", preferences.getValidatorIndex().bigIntegerValue());
eventNode.put("target_gas_limit", preferences.getTargetGasLimit().bigIntegerValue());
eventNode.put("message_size", messageSize);
eventNode.put("peer_id", peerId);
eventNode.put("message_id", messageId);
eventNode.put("topic", topic);
eventNode.put("fee_recipient", preferences.getFeeRecipient().getWrappedBytes().toHexString());
return Optional.of(eventNode);
}

// Unknown type - skip (e.g. SyncCommitteeMessage, SignedContributionAndProof)
Expand Down
2 changes: 1 addition & 1 deletion scripts/apply-temu-patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ echo -e "${GREEN} Copied plugins/xatu/${NC}"
echo ""
echo -e "${BLUE}=== Downloading libxatu ===${NC}"

XATU_SIDECAR_VERSION="v0.0.6"
XATU_SIDECAR_VERSION="v0.0.7"
if [ ! -f "libxatu.so" ]; then
echo -e "${BLUE} Downloading libxatu.so (${XATU_SIDECAR_VERSION})...${NC}"

Expand Down
Loading