-
Notifications
You must be signed in to change notification settings - Fork 2
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
chore(eigenda): Bump eigenda-proxy to latest v1.6.0 #48
Changes from 3 commits
59f7ae6
a53fe5c
17436e9
ddeea5f
b29bf11
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ import ( | |
) | ||
|
||
var ( | ||
SvcUnavailableErr = fmt.Errorf("eigenda service is unavailable") | ||
ErrServiceUnavailable = fmt.Errorf("eigenda service is unavailable") | ||
) | ||
|
||
type EigenDAProxyClient struct { | ||
|
@@ -123,21 +123,22 @@ func (c *client) GetData(ctx context.Context, comm []byte) ([]byte, error) { | |
|
||
defer resp.Body.Close() | ||
|
||
if resp.StatusCode != http.StatusOK { | ||
return nil, fmt.Errorf("received unexpected response code: %d", resp.StatusCode) | ||
b, err := io.ReadAll(resp.Body) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
if resp.StatusCode == http.StatusServiceUnavailable { | ||
return nil, SvcUnavailableErr | ||
Comment on lines
-130
to
-131
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you really mean to remove this? Is ErrSvcUnavailable returned somewhere else? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ahh incredible catch 🙏🏻 |
||
if resp.StatusCode != http.StatusOK { | ||
return nil, fmt.Errorf("received error response, code=%d, msg = %s", resp.StatusCode, string(b)) | ||
} | ||
|
||
return io.ReadAll(resp.Body) | ||
return b, nil | ||
} | ||
|
||
// SetData writes raw byte data to DA and returns the associated certificate | ||
// which should be verified within the proxy | ||
func (c *client) SetData(ctx context.Context, b []byte) ([]byte, error) { | ||
url := fmt.Sprintf("%s/put/?commitment_mode=simple", c.cfg.URL) | ||
url := fmt.Sprintf("%s/put?commitment_mode=simple", c.cfg.URL) | ||
req, err := http.NewRequestWithContext(ctx, http.MethodPost, url, bytes.NewReader(b)) | ||
if err != nil { | ||
return nil, fmt.Errorf("failed to create HTTP request: %w", err) | ||
|
@@ -148,15 +149,16 @@ func (c *client) SetData(ctx context.Context, b []byte) ([]byte, error) { | |
return nil, err | ||
} | ||
defer resp.Body.Close() | ||
if resp.StatusCode != http.StatusOK { | ||
return nil, fmt.Errorf("failed to store data: %v", resp.StatusCode) | ||
} | ||
|
||
b, err = io.ReadAll(resp.Body) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
if resp.StatusCode != http.StatusOK { | ||
return nil, fmt.Errorf("failed to store data: %v, err = %s", resp.StatusCode, string(b)) | ||
} | ||
|
||
if len(b) == 0 { | ||
return nil, fmt.Errorf("read certificate is empty") | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,31 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "Pull eigenda-proxy container" | ||
docker pull ghcr.io/layr-labs/eigenda-proxy@sha256:10a4762f5c43e9037835617e6ec0b03da34012df87048a363f43b969ab93679b | ||
echo "==== Pull eigenda-proxy container ====" | ||
docker pull ghcr.io/layr-labs/eigenda-proxy:v1.6.0 | ||
|
||
echo "Tagging image" | ||
docker tag ghcr.io/layr-labs/eigenda-proxy@sha256:10a4762f5c43e9037835617e6ec0b03da34012df87048a363f43b969ab93679b eigenda-proxy-nitro-test | ||
echo "==== Starting eigenda-proxy container ====" | ||
|
||
echo "Start eigenda-proxy container" | ||
# proxy has a bug currently which forces the use of the service manager address | ||
# & eth rpc despite cert verification being disabled. | ||
|
||
docker run -d --name eigenda-proxy-nitro-test \ | ||
docker run -d --name eigenda-proxy-nitro-test-instance \ | ||
-p 4242:6666 \ | ||
-e EIGENDA_PROXY_ADDR=0.0.0.0 \ | ||
-e EIGENDA_PROXY_PORT=6666 \ | ||
-e MEMSTORE_ENABLED=true \ | ||
-e MEMSTORE_EXPIRATION=1m \ | ||
-e EIGENDA_PROXY_TARGET_URL=http://localhost:3000 \ | ||
eigenda-proxy-nitro-test | ||
-e EIGENDA_PROXY_MEMSTORE_ENABLED=true \ | ||
-e EIGENDA_PROXY_MEMSTORE_EXPIRATION=1m \ | ||
-e EIGENDA_PROXY_EIGENDA_ETH_RPC=http://localhost:6969 \ | ||
-e EIGENDA_PROXY_EIGENDA_SERVICE_MANAGER_ADDR="0x0000000000000000000000000000000000000000" \ | ||
-e EIGENDA_PROXY_EIGENDA_CERT_VERIFICATION_DISABLED=true \ | ||
ghcr.io/layr-labs/eigenda-proxy:v1.6.0 | ||
|
||
# shellcheck disable=SC2181 | ||
if [ $? -ne 0 ]; then | ||
echo "==== Failed to start eigenda-proxy container ====" | ||
exit 1 | ||
fi | ||
Comment on lines
+23
to
+26
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: this will catch if docker didn't manager to start the process, but won't catch if the process is started but crashed on startup. |
||
|
||
echo "==== eigenda-proxy container started ====" | ||
|
||
## TODO - support teardown or embed a docker client wrapper that spins up and tears down resource | ||
# within system tests. Since this is only used by one system test, it's not a large priority atm. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: wrap err with
resp.StatusCode