Skip to content

Commit

Permalink
alt-DA: write to /put path as described in spec
Browse files Browse the repository at this point in the history
The spec mandates using `/put` and not `/put/`, so that is what we
should do.

Warning: This will break DA solutions that only accept `/put/` at the
moment. It is recommended that DA solutions support both paths for a
while, so that updating OP-stack can happen independently of the exact
DA implementation version.

Closes ethereum-optimism#11499.
  • Loading branch information
karlb committed Sep 24, 2024
1 parent 554b470 commit 93c82cd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion op-alt-da/daclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func (c *DAClient) setInput(ctx context.Context, img []byte) (CommitmentData, er
}

body := bytes.NewReader(img)
url := fmt.Sprintf("%s/put/", c.url)
url := fmt.Sprintf("%s/put", c.url)
req, err := http.NewRequestWithContext(ctx, http.MethodPost, url, body)
if err != nil {
return nil, fmt.Errorf("failed to create HTTP request: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion op-alt-da/damock.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func (s *FakeDAServer) Start() error {
// Override the HandleGet/Put method registrations
mux := http.NewServeMux()
mux.HandleFunc("/get/", s.HandleGet)
mux.HandleFunc("/put/", s.HandlePut)
mux.HandleFunc("/put", s.HandlePut)
s.httpServer.Handler = mux
return nil
}
Expand Down

0 comments on commit 93c82cd

Please sign in to comment.