Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Resolve commitment decoding bug #65

Merged
merged 1 commit into from
Aug 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"net/http"
"path"
"strconv"
"strings"
"time"

"github.com/Layr-Labs/eigenda-proxy/commitments"
Expand Down Expand Up @@ -260,6 +261,10 @@ func ReadCommitmentMode(r *http.Request) (commitments.CommitmentMode, error) {
if key == "" { // default
commit := path.Base(r.URL.Path)
if len(commit) > 0 && commit != "put" { // provided commitment in request params
if !strings.HasPrefix(commit, "0x") {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An related thing, when I use eigenda-proxy through curl. I have to put
127.0.0.1:3100/put/
If I miss the last "/", the eigenda-proxy would not be able to respond. Is it expected based on some standard, or something we can fix

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its expected based on a standard - given that client interactions are done programmatically its probably ok to keep it this way

commit = "0x" + commit
}

decodedCommit, err := hexutil.Decode(commit)
if err != nil {
return commitments.SimpleCommitmentMode, err
Expand Down
Loading