Skip to content

Commit

Permalink
feat: OP Stack integration test - cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
EthenNotEthan committed Jun 12, 2024
1 parent 58bae25 commit 1b58c55
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
15 changes: 6 additions & 9 deletions e2e/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@ import (
"github.com/stretchr/testify/require"
)

// Use of single port makes tests incapable of running in parallel
const (
PrivateKey = "SIGNER_PRIVATE_KEY"
privateKey = "SIGNER_PRIVATE_KEY"
transport = "http"
SvcName = "eigenda_proxy"
svcName = "eigenda_proxy"
host = "127.0.0.1"
HoleskyDA = "disperser-holesky.eigenda.xyz:443"
holeskyDA = "disperser-holesky.eigenda.xyz:443"
)

type TestSuite struct {
Expand All @@ -39,7 +38,7 @@ func CreateTestSuite(t *testing.T, useMemory bool) (TestSuite, func()) {
ctx := context.Background()

// load signer key from environment
pk := os.Getenv(PrivateKey)
pk := os.Getenv(privateKey)
if pk == "" && !useMemory {
t.Fatal("SIGNER_PRIVATE_KEY environment variable not set")
}
Expand All @@ -48,13 +47,11 @@ func CreateTestSuite(t *testing.T, useMemory bool) (TestSuite, func()) {
Level: log.LevelDebug,
Format: oplog.FormatLogFmt,
Color: true,
}).New("role", SvcName)

// oplog.SetGlobalLogHandler(log.Handler())
}).New("role", svcName)

eigendaCfg := eigenda.Config{
ClientConfig: clients.EigenDAClientConfig{
RPC: HoleskyDA,
RPC: holeskyDA,
StatusQueryTimeout: time.Minute * 45,
StatusQueryRetryInterval: time.Second * 1,
DisableTLS: false,
Expand Down
2 changes: 1 addition & 1 deletion scripts/op-devnet-allocs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ if [ $? -eq 0 ] ; then
exit ${STATUS}
else
echo "Failed to clean up ${REPO_NAME} repo"
exit ${STATUS
exit ${STATUS}
4 changes: 2 additions & 2 deletions store/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ func (e *MemStore) pruneExpired() {
// Get fetches a value from the store.
func (e *MemStore) Get(ctx context.Context, commit []byte, domain eigendacommon.DomainType) ([]byte, error) {
e.reads += 1
e.RLock()
defer e.RUnlock()
e.Lock()
defer e.Unlock()

var cert common.Certificate
err := rlp.DecodeBytes(commit, &cert)
Expand Down
2 changes: 1 addition & 1 deletion store/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ type Store interface {
Get(ctx context.Context, key []byte, domain common.DomainType) ([]byte, error)
// Put inserts the given value into the key-value data store.
Put(ctx context.Context, value []byte) (key []byte, err error)
// Entries returns the number of values in the store; only used for memstore
// Stats returns the current usage metrics of the key-value data store.
Stats() *common.Stats
}

0 comments on commit 1b58c55

Please sign in to comment.