Skip to content

Commit

Permalink
Updated Smartnode, added a bigger MaxConcurrentEth1Requests buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
jclapis committed Nov 19, 2022
1 parent 8da366f commit e28d56e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/ethereum/go-ethereum v1.10.25
github.com/fatih/color v1.13.0
github.com/rocket-pool/rocketpool-go v1.10.1-0.20221107074643-c7bbb1946848
github.com/rocket-pool/smartnode v1.7.1-0.20221108051433-199b03a781ec
github.com/rocket-pool/smartnode v1.7.1-0.20221119044341-133db7b548d6
github.com/urfave/cli/v2 v2.23.0
)

Expand Down
8 changes: 2 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1709,12 +1709,8 @@ github.com/rocket-pool/go-merkletree v1.0.1-0.20220406020931-c262d9b976dd h1:p9K
github.com/rocket-pool/go-merkletree v1.0.1-0.20220406020931-c262d9b976dd/go.mod h1:UE9fof8P7iESVtLn1K9CTSkNRYVFHZHlf96RKbU33kA=
github.com/rocket-pool/rocketpool-go v1.10.1-0.20221107074643-c7bbb1946848 h1:Iny1IgKEv3/0eUyPoExnXlyXNzUtGda+JAa2m0KlVrQ=
github.com/rocket-pool/rocketpool-go v1.10.1-0.20221107074643-c7bbb1946848/go.mod h1:+7kSXEvMUCEqstio3PBVTnaGoI2lSTwNUJ8/D4D91gM=
github.com/rocket-pool/smartnode v1.7.1-0.20221108031637-a1192d4790c9 h1:aMKBhdkrA9CT812b4CJ9VI6NQhpK31dfkqHhZfZtjn0=
github.com/rocket-pool/smartnode v1.7.1-0.20221108031637-a1192d4790c9/go.mod h1:22NUpU97G9Oz7O4sD5yPYbiUnaQu7eun1SAHHL7SdMY=
github.com/rocket-pool/smartnode v1.7.1-0.20221108044127-fca9776b91a2 h1:wQ1Jl+SKbMawF7q7QmzkfiliyqYKBYATfUMHz8C2zfA=
github.com/rocket-pool/smartnode v1.7.1-0.20221108044127-fca9776b91a2/go.mod h1:22NUpU97G9Oz7O4sD5yPYbiUnaQu7eun1SAHHL7SdMY=
github.com/rocket-pool/smartnode v1.7.1-0.20221108051433-199b03a781ec h1:WHhbLQTtNTgg0xtgoOePhiE+6u65pd7mLlQvyjXyUPA=
github.com/rocket-pool/smartnode v1.7.1-0.20221108051433-199b03a781ec/go.mod h1:22NUpU97G9Oz7O4sD5yPYbiUnaQu7eun1SAHHL7SdMY=
github.com/rocket-pool/smartnode v1.7.1-0.20221119044341-133db7b548d6 h1:RMjEEpeBHIJZxlSDgAVLP7ozhQnst4en1YM8YecNlHo=
github.com/rocket-pool/smartnode v1.7.1-0.20221119044341-133db7b548d6/go.mod h1:22NUpU97G9Oz7O4sD5yPYbiUnaQu7eun1SAHHL7SdMY=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
Expand Down
18 changes: 18 additions & 0 deletions tree-gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"io/ioutil"
"math/big"
"net/http"
"path/filepath"
"time"

Expand All @@ -24,8 +25,15 @@ import (
"github.com/urfave/cli/v2"
)

const (
MaxConcurrentEth1Requests = 200
)

func GenerateTree(c *cli.Context) error {

// Configure
configureHTTP()

// Initialization
currentIndex := c.Int64("interval")
log := log.NewColorLogger(color.FgHiWhite)
Expand Down Expand Up @@ -317,3 +325,13 @@ func getLatestFinalizedSlot(log log.ColorLogger, bn beacon.Client) (uint64, uint
}

}

// Configure HTTP transport settings
func configureHTTP() {

// The watchtower daemon makes a large number of concurrent RPC requests to the Eth1 client
// The HTTP transport is set to cache connections for future re-use equal to the maximum expected number of concurrent requests
// This prevents issues related to memory consumption and address allowance from repeatedly opening and closing connections
http.DefaultTransport.(*http.Transport).MaxIdleConnsPerHost = MaxConcurrentEth1Requests

}

0 comments on commit e28d56e

Please sign in to comment.