mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 04:36:42 +00:00
advertise all forks
This commit is contained in:
parent
85445ac3b6
commit
afa27a4f59
2 changed files with 11 additions and 3 deletions
|
|
@ -40,7 +40,7 @@ func (rt *Router) handleCapabilities(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
resp := capabilitiesResponse{
|
||||
SupportedForks: []string{"amsterdam"},
|
||||
SupportedForks: []string{"paris", "shanghai", "cancun", "prague", "osaka", "amsterdam"},
|
||||
ForkScopedEndpoints: []string{"payloads", "forkchoice", "bodies"},
|
||||
IndependentlyVersioned: map[string][]string{
|
||||
"blobs": {"v1", "v2", "v3", "v4"},
|
||||
|
|
|
|||
|
|
@ -245,8 +245,16 @@ func TestRouterCapabilities(t *testing.T) {
|
|||
if err := json.NewDecoder(resp.Body).Decode(&c); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if len(c.SupportedForks) == 0 || c.SupportedForks[0] != "amsterdam" {
|
||||
t.Errorf("supported forks: %v", c.SupportedForks)
|
||||
// Capabilities must advertise every fork the router routes, so a consensus
|
||||
// client negotiates SSZ for all of them rather than falling back to JSON-RPC.
|
||||
want := map[string]bool{"paris": true, "shanghai": true, "cancun": true, "prague": true, "osaka": true, "amsterdam": true}
|
||||
if len(c.SupportedForks) != len(want) {
|
||||
t.Errorf("supported forks: got %v, want all of %v", c.SupportedForks, want)
|
||||
}
|
||||
for _, f := range c.SupportedForks {
|
||||
if !want[f] {
|
||||
t.Errorf("unexpected fork advertised: %q", f)
|
||||
}
|
||||
}
|
||||
if got := c.Limits["blobs.max_versioned_hashes"]; got != sszt.MaxBlobsRequest {
|
||||
t.Errorf("blobs limit: %d", got)
|
||||
|
|
|
|||
Loading…
Reference in a new issue