From 9fd147b6baebf9315977cb222f6ec5d8082a47e3 Mon Sep 17 00:00:00 2001 From: Paul Harris Date: Wed, 19 Feb 2025 08:58:29 +1100 Subject: [PATCH 1/3] Updating contribution guidelines for first time contributors. (#9145) Signed-off-by: Paul Harris --- CONTRIBUTING.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6ce2a650e03..2d4268fec7b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,7 +33,19 @@ Start by looking through the 'good first issue' and 'help wanted' issues: * [Good First Issue][search-label-good-first-issue] - issues which should only require a few lines of code, and a test or two. * [Help wanted issues][search-label-help-wanted] - issues that are a bit more involved than `good first issue` issues. -Please keep in mind that we do not accept non-code contributions like fixing comments, typos or some other trivial fixes. Although we appreciate the extra help, managing lots of these small contributions is unfeasible, and puts extra pressure in our continuous delivery systems (running all tests, etc). Feel free to open an issue pointing any of those errors and we will batch them into a single change. +Please reach out in discord if you're looking to help out, and we can assist you in finding a good candidate ticket to work on, or discuss the idea you have. + +We have a [Teku](https://discord.com/channels/697535391594446898/697539289042649190) channel, and also a [Teku Contributors](https://discord.com/channels/697535391594446898/1050616638497640548) channel. + +Due to the prevalence of 'airdrop farming' type practices, this unfortunately puts heightened scrutiny on first time contributors, but if you're genuinely looking to help out, we'd really love to assist you in any way we can. +This does mean however that we will generally reject 'random' fixes such as 'TODO' fixes, typos, and generally things that add no value that we haven't identified as something we need. These are likely to be rejected with 'due to contribution guidelines' type responses. +This includes but is not limited to +* code replacement of TODO's that are not well tested or justified by performance and regression tests to prove their worth. +* typos, even if valid, will be worked into other PRs or just ignored completely if they're from first time contributors with no substantative value. +* things like replacing RuntimeException with a new exception type that's not well tested and adding value. +* rewording of comments + +Minimal discussion will be given in PR's due to the volume we're needing to deal with currently of this type of PR, which is taking away from actual development time, so please don't be offended if you're genuinely trying to help out; and we say 'see contribution guidelines'. ### Local Development The codebase is maintained using the "*contributor workflow*" where everyone without exception contributes patch proposals using "*pull-requests*". This facilitates social contribution, easy testing and peer review. From fb9f670d65b4972f47e5f62d6fef8de2eaece2ea Mon Sep 17 00:00:00 2001 From: Paul Harris Date: Wed, 19 Feb 2025 16:31:40 +1100 Subject: [PATCH 2/3] rate-limit executor queue warning (#9128) fixes #9126 Rate limiting this message as it can come out very quickly, especially while starting. Signed-off-by: Paul Harris --- .../topics/topichandlers/Eth2TopicHandler.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/networking/eth2/src/main/java/tech/pegasys/teku/networking/eth2/gossip/topics/topichandlers/Eth2TopicHandler.java b/networking/eth2/src/main/java/tech/pegasys/teku/networking/eth2/gossip/topics/topichandlers/Eth2TopicHandler.java index a3c3e11ce38..e9c0d9987ae 100644 --- a/networking/eth2/src/main/java/tech/pegasys/teku/networking/eth2/gossip/topics/topichandlers/Eth2TopicHandler.java +++ b/networking/eth2/src/main/java/tech/pegasys/teku/networking/eth2/gossip/topics/topichandlers/Eth2TopicHandler.java @@ -27,6 +27,8 @@ import tech.pegasys.teku.infrastructure.exceptions.ExceptionUtil; import tech.pegasys.teku.infrastructure.ssz.SszData; import tech.pegasys.teku.infrastructure.ssz.schema.SszSchema; +import tech.pegasys.teku.infrastructure.time.Throttler; +import tech.pegasys.teku.infrastructure.time.TimeProvider; import tech.pegasys.teku.infrastructure.unsigned.UInt64; import tech.pegasys.teku.networking.eth2.gossip.encoding.DecodingException; import tech.pegasys.teku.networking.eth2.gossip.encoding.Eth2PreparedGossipMessageFactory; @@ -56,6 +58,10 @@ public class Eth2TopicHandler implements TopicHandler private final NetworkingSpecConfig networkingConfig; private final DebugDataDumper debugDataDumper; private final String topic; + final TimeProvider timeProvider; + + // every slot of mainnet config + private final Throttler loggerThrottler = new Throttler<>(LOG, UInt64.valueOf(12)); public Eth2TopicHandler( final RecentChainData recentChainData, @@ -79,6 +85,7 @@ public Eth2TopicHandler( gossipEncoding.createPreparedGossipMessageFactory( recentChainData::getMilestoneByForkDigest); this.debugDataDumper = debugDataDumper; + this.timeProvider = recentChainData.getStore(); this.topic = GossipTopics.getTopic(forkDigest, topicName, gossipEncoding); } @@ -173,8 +180,12 @@ protected ValidationResult handleMessageProcessingError( P2P_LOG.onGossipMessageDecodingError(getTopic(), message.getOriginalMessage(), err); response = ValidationResult.Invalid; } else if (ExceptionUtil.hasCause(err, RejectedExecutionException.class)) { - LOG.warn( - "Discarding gossip message for topic {} because the executor queue is full", getTopic()); + loggerThrottler.invoke( + timeProvider.getTimeInSeconds(), + (log) -> + LOG.warn( + "Discarding gossip message for topic {} because the executor queue is full", + getTopic())); response = ValidationResult.Ignore; } else if (ExceptionUtil.hasCause(err, ServiceCapacityExceededException.class)) { LOG.warn( From 41577e971f9d6bfe7a6eea1eac27cf1bae878541 Mon Sep 17 00:00:00 2001 From: Enrico Del Fante Date: Wed, 19 Feb 2025 15:48:42 +0100 Subject: [PATCH 3/3] Builder client - handle exception in request (#9148) * Builder client - handle exception in request * spotlessly --- .../ethereum/executionclient/rest/OkHttpRestClient.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/rest/OkHttpRestClient.java b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/rest/OkHttpRestClient.java index b64c17651aa..1c6277b7a05 100644 --- a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/rest/OkHttpRestClient.java +++ b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/rest/OkHttpRestClient.java @@ -16,6 +16,7 @@ import static java.util.Objects.requireNonNull; import java.io.IOException; +import java.io.UncheckedIOException; import java.net.URL; import java.util.Map; import java.util.Optional; @@ -120,8 +121,12 @@ private RequestBody createOctetStreamRequestBody(final S req return new RequestBody() { @Override - public void writeTo(final BufferedSink bufferedSink) { - requestBodyObject.sszSerialize(bufferedSink.outputStream()); + public void writeTo(final BufferedSink bufferedSink) throws IOException { + try { + requestBodyObject.sszSerialize(bufferedSink.outputStream()); + } catch (final UncheckedIOException e) { + throw e.getCause(); + } } @Override