From 4e41d5c61088f6d28d46c028f1b4d4ae00f20d98 Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Fri, 7 Mar 2025 13:00:16 -0600 Subject: [PATCH] fixing e2e builder gas limit (#15025) * fixing e2e * linting --- changelog/james-prysm_fix-builder-e2e.md | 4 ++++ testing/endtoend/components/eth1/miner.go | 1 + testing/endtoend/components/eth1/node.go | 1 + testing/middleware/builder/builder.go | 14 +++++--------- 4 files changed, 11 insertions(+), 9 deletions(-) create mode 100644 changelog/james-prysm_fix-builder-e2e.md diff --git a/changelog/james-prysm_fix-builder-e2e.md b/changelog/james-prysm_fix-builder-e2e.md new file mode 100644 index 0000000000..c2b22fb76e --- /dev/null +++ b/changelog/james-prysm_fix-builder-e2e.md @@ -0,0 +1,4 @@ +### Fixed + +- Fixes printing superfluous response.WriteHeader call from error in builder. +- Fixes e2e run with builder having wrong gaslimit header due to not being set on eth1 nodes. \ No newline at end of file diff --git a/testing/endtoend/components/eth1/miner.go b/testing/endtoend/components/eth1/miner.go index 461c293993..d446661777 100644 --- a/testing/endtoend/components/eth1/miner.go +++ b/testing/endtoend/components/eth1/miner.go @@ -146,6 +146,7 @@ func (m *Miner) initAttempt(ctx context.Context, attempt int) (*os.File, error) fmt.Sprintf("--unlock=%s", EthAddress), "--allow-insecure-unlock", "--syncmode=full", + fmt.Sprintf("--miner.gaslimit=%d", params.BeaconConfig().DefaultBuilderGasLimit), fmt.Sprintf("--txpool.locals=%s", EthAddress), fmt.Sprintf("--password=%s", pwFile), } diff --git a/testing/endtoend/components/eth1/node.go b/testing/endtoend/components/eth1/node.go index e3296dcc80..d9d3f799f6 100644 --- a/testing/endtoend/components/eth1/node.go +++ b/testing/endtoend/components/eth1/node.go @@ -110,6 +110,7 @@ func (node *Node) Start(ctx context.Context) error { "--ipcdisable", "--verbosity=4", "--syncmode=full", + fmt.Sprintf("--miner.gaslimit=%d", params.BeaconConfig().DefaultBuilderGasLimit), fmt.Sprintf("--txpool.locals=%s", EthAddress), } diff --git a/testing/middleware/builder/builder.go b/testing/middleware/builder/builder.go index cff17b467b..e7656edcbc 100644 --- a/testing/middleware/builder/builder.go +++ b/testing/middleware/builder/builder.go @@ -399,7 +399,7 @@ func (p *Builder) handleHeaderRequest(w http.ResponseWriter, req *http.Request) Message: bid, }, } - + w.WriteHeader(http.StatusOK) err = json.NewEncoder(w).Encode(hdrResp) if err != nil { p.cfg.logger.WithError(err).Error("Could not encode response") @@ -408,7 +408,6 @@ func (p *Builder) handleHeaderRequest(w http.ResponseWriter, req *http.Request) } p.currVersion = version.Bellatrix p.currPayload = wObj - w.WriteHeader(http.StatusOK) } func (p *Builder) handleHeaderRequestCapella(w http.ResponseWriter) { @@ -477,7 +476,7 @@ func (p *Builder) handleHeaderRequestCapella(w http.ResponseWriter) { Message: bid, }, } - + w.WriteHeader(http.StatusOK) err = json.NewEncoder(w).Encode(hdrResp) if err != nil { p.cfg.logger.WithError(err).Error("Could not encode response") @@ -486,7 +485,6 @@ func (p *Builder) handleHeaderRequestCapella(w http.ResponseWriter) { } p.currVersion = version.Capella p.currPayload = wObj - w.WriteHeader(http.StatusOK) } func (p *Builder) handleHeaderRequestDeneb(w http.ResponseWriter) { @@ -563,7 +561,7 @@ func (p *Builder) handleHeaderRequestDeneb(w http.ResponseWriter) { Message: bid, }, } - + w.WriteHeader(http.StatusOK) err = json.NewEncoder(w).Encode(hdrResp) if err != nil { p.cfg.logger.WithError(err).Error("Could not encode response") @@ -573,7 +571,6 @@ func (p *Builder) handleHeaderRequestDeneb(w http.ResponseWriter) { p.currVersion = version.Deneb p.currPayload = wObj p.blobBundle = b.BlobsBundle - w.WriteHeader(http.StatusOK) } func (p *Builder) handleHeaderRequestElectra(w http.ResponseWriter) { @@ -697,7 +694,7 @@ func (p *Builder) handleHeaderRequestElectra(w http.ResponseWriter) { Message: bid, }, } - + w.WriteHeader(http.StatusOK) err = json.NewEncoder(w).Encode(hdrResp) if err != nil { p.cfg.logger.WithError(err).Error("Could not encode response") @@ -707,7 +704,6 @@ func (p *Builder) handleHeaderRequestElectra(w http.ResponseWriter) { p.currVersion = version.Electra p.currPayload = wObj p.blobBundle = b.BlobsBundle - w.WriteHeader(http.StatusOK) } func (p *Builder) handleBlindedBlock(w http.ResponseWriter, req *http.Request) { @@ -732,13 +728,13 @@ func (p *Builder) handleBlindedBlock(w http.ResponseWriter, req *http.Request) { http.Error(w, err.Error(), http.StatusInternalServerError) return } + w.WriteHeader(http.StatusOK) err = json.NewEncoder(w).Encode(resp) if err != nil { p.cfg.logger.WithError(err).Error("Could not encode full payload response") http.Error(w, err.Error(), http.StatusInternalServerError) return } - w.WriteHeader(http.StatusOK) } var errInvalidTypeConversion = errors.New("unable to translate between api and foreign type")