Skip to content

Commit 0ce872d

Browse files
james-prysmfernantho
authored andcommitted
fixing e2e builder gas limit (OffchainLabs#15025)
* fixing e2e * linting
1 parent abcd26e commit 0ce872d

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
### Fixed
2+
3+
- Fixes printing superfluous response.WriteHeader call from error in builder.
4+
- Fixes e2e run with builder having wrong gaslimit header due to not being set on eth1 nodes.

testing/endtoend/components/eth1/miner.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ func (m *Miner) initAttempt(ctx context.Context, attempt int) (*os.File, error)
146146
fmt.Sprintf("--unlock=%s", EthAddress),
147147
"--allow-insecure-unlock",
148148
"--syncmode=full",
149+
fmt.Sprintf("--miner.gaslimit=%d", params.BeaconConfig().DefaultBuilderGasLimit),
149150
fmt.Sprintf("--txpool.locals=%s", EthAddress),
150151
fmt.Sprintf("--password=%s", pwFile),
151152
}

testing/endtoend/components/eth1/node.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ func (node *Node) Start(ctx context.Context) error {
110110
"--ipcdisable",
111111
"--verbosity=4",
112112
"--syncmode=full",
113+
fmt.Sprintf("--miner.gaslimit=%d", params.BeaconConfig().DefaultBuilderGasLimit),
113114
fmt.Sprintf("--txpool.locals=%s", EthAddress),
114115
}
115116

testing/middleware/builder/builder.go

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ func (p *Builder) handleHeaderRequest(w http.ResponseWriter, req *http.Request)
399399
Message: bid,
400400
},
401401
}
402-
402+
w.WriteHeader(http.StatusOK)
403403
err = json.NewEncoder(w).Encode(hdrResp)
404404
if err != nil {
405405
p.cfg.logger.WithError(err).Error("Could not encode response")
@@ -408,7 +408,6 @@ func (p *Builder) handleHeaderRequest(w http.ResponseWriter, req *http.Request)
408408
}
409409
p.currVersion = version.Bellatrix
410410
p.currPayload = wObj
411-
w.WriteHeader(http.StatusOK)
412411
}
413412

414413
func (p *Builder) handleHeaderRequestCapella(w http.ResponseWriter) {
@@ -477,7 +476,7 @@ func (p *Builder) handleHeaderRequestCapella(w http.ResponseWriter) {
477476
Message: bid,
478477
},
479478
}
480-
479+
w.WriteHeader(http.StatusOK)
481480
err = json.NewEncoder(w).Encode(hdrResp)
482481
if err != nil {
483482
p.cfg.logger.WithError(err).Error("Could not encode response")
@@ -486,7 +485,6 @@ func (p *Builder) handleHeaderRequestCapella(w http.ResponseWriter) {
486485
}
487486
p.currVersion = version.Capella
488487
p.currPayload = wObj
489-
w.WriteHeader(http.StatusOK)
490488
}
491489

492490
func (p *Builder) handleHeaderRequestDeneb(w http.ResponseWriter) {
@@ -563,7 +561,7 @@ func (p *Builder) handleHeaderRequestDeneb(w http.ResponseWriter) {
563561
Message: bid,
564562
},
565563
}
566-
564+
w.WriteHeader(http.StatusOK)
567565
err = json.NewEncoder(w).Encode(hdrResp)
568566
if err != nil {
569567
p.cfg.logger.WithError(err).Error("Could not encode response")
@@ -573,7 +571,6 @@ func (p *Builder) handleHeaderRequestDeneb(w http.ResponseWriter) {
573571
p.currVersion = version.Deneb
574572
p.currPayload = wObj
575573
p.blobBundle = b.BlobsBundle
576-
w.WriteHeader(http.StatusOK)
577574
}
578575

579576
func (p *Builder) handleHeaderRequestElectra(w http.ResponseWriter) {
@@ -697,7 +694,7 @@ func (p *Builder) handleHeaderRequestElectra(w http.ResponseWriter) {
697694
Message: bid,
698695
},
699696
}
700-
697+
w.WriteHeader(http.StatusOK)
701698
err = json.NewEncoder(w).Encode(hdrResp)
702699
if err != nil {
703700
p.cfg.logger.WithError(err).Error("Could not encode response")
@@ -707,7 +704,6 @@ func (p *Builder) handleHeaderRequestElectra(w http.ResponseWriter) {
707704
p.currVersion = version.Electra
708705
p.currPayload = wObj
709706
p.blobBundle = b.BlobsBundle
710-
w.WriteHeader(http.StatusOK)
711707
}
712708

713709
func (p *Builder) handleBlindedBlock(w http.ResponseWriter, req *http.Request) {
@@ -732,13 +728,13 @@ func (p *Builder) handleBlindedBlock(w http.ResponseWriter, req *http.Request) {
732728
http.Error(w, err.Error(), http.StatusInternalServerError)
733729
return
734730
}
731+
w.WriteHeader(http.StatusOK)
735732
err = json.NewEncoder(w).Encode(resp)
736733
if err != nil {
737734
p.cfg.logger.WithError(err).Error("Could not encode full payload response")
738735
http.Error(w, err.Error(), http.StatusInternalServerError)
739736
return
740737
}
741-
w.WriteHeader(http.StatusOK)
742738
}
743739

744740
var errInvalidTypeConversion = errors.New("unable to translate between api and foreign type")

0 commit comments

Comments
 (0)