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

Add EdgelessDB flag + IsSGXEnabled flag #1365

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
integration/.build/simulations/sim-log-*.txt
integration/.build/noderunner/noderunner-*.txt
integration/.build/wallet_extension/wal-ext-*.txt
integration/.build/faucet/*
integration/.build/eth2/*
retention-days: 2

Expand Down
1 change: 1 addition & 0 deletions integration/faucet/faucet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ func TestFaucet(t *testing.T) {
err = fundWallet(faucetConfig.ServerPort, rndWallet)
assert.NoError(t, err)

time.Sleep(2 * time.Second) // make sure the faucet has started
obsClient, err := obsclient.DialWithAuth(fmt.Sprintf("http://%s:%d", network.Localhost, startPort+integration.DefaultHostRPCHTTPOffset), rndWallet, testlog.Logger())
assert.NoError(t, err)

Expand Down
12 changes: 12 additions & 0 deletions testnet/launcher/cmd/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ type TestnetConfigCLI struct {
validatorEnclaveDebug bool
sequencerEnclaveDockerImage string
sequencerEnclaveDebug bool

isSGXEnabled bool

edgelessDBDockerImage string
}

// ParseConfigCLI returns a NodeConfigCLI based the cli params and defaults.
Expand All @@ -21,12 +25,20 @@ func ParseConfigCLI() *TestnetConfigCLI {
validatorEnclaveDebug := flag.Bool(validatorEnclaveDebugFlag, false, flagUsageMap[validatorEnclaveDebugFlag])
sequencerEnclaveDockerImage := flag.String(sequencerEnclaveDockerImageFlag, "testnetobscuronet.azurecr.io/obscuronet/enclave:latest", flagUsageMap[sequencerEnclaveDockerImageFlag])
sequencerEnclaveDebug := flag.Bool(sequencerEnclaveDebugFlag, false, flagUsageMap[sequencerEnclaveDebugFlag])

edgelessDBDockerImage := flag.String(edgelessDBDockerImageFlag, "ghcr.io/edgelesssys/edgelessdb-sgx-4gb:v0.3.2", flagUsageMap[edgelessDBDockerImageFlag])

isSGXEnabled := flag.Bool(isSGXEnabledFlag, false, flagUsageMap[isSGXEnabledFlag])
flag.Parse()

cfg.validatorEnclaveDockerImage = *validatorEnclaveDockerImage
cfg.sequencerEnclaveDockerImage = *sequencerEnclaveDockerImage
cfg.validatorEnclaveDebug = *validatorEnclaveDebug
cfg.sequencerEnclaveDebug = *sequencerEnclaveDebug

cfg.isSGXEnabled = *isSGXEnabled

cfg.edgelessDBDockerImage = *edgelessDBDockerImage

return cfg
}
8 changes: 8 additions & 0 deletions testnet/launcher/cmd/cli_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ const (
validatorEnclaveDebugFlag = "validator-enclave-debug"
sequencerEnclaveDockerImageFlag = "sequencer-enclave-docker-image"
sequencerEnclaveDebugFlag = "sequencer-enclave-debug"

edgelessDBDockerImageFlag = "edgelessDB-docker-image"

isSGXEnabledFlag = "is-sgx-enabled"
)

// Returns a map of the flag usages.
Expand All @@ -16,5 +20,9 @@ func getFlagUsageMap() map[string]string {
validatorEnclaveDebugFlag: "Enables the use of DLV to debug the validator enclave",
sequencerEnclaveDockerImageFlag: "The docker image that runs the sequencer enclave",
sequencerEnclaveDebugFlag: "Enables the use of DLV to debug the sequencer enclave",

edgelessDBDockerImageFlag: "The docker image that runs the edgelessDB",

isSGXEnabledFlag: "Whether sgx is enabled",
}
}
2 changes: 2 additions & 0 deletions testnet/launcher/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ func main() {
launcher.WithValidatorEnclaveDebug(cliConfig.validatorEnclaveDebug),
launcher.WithSequencerEnclaveDockerImage(cliConfig.sequencerEnclaveDockerImage),
launcher.WithSequencerEnclaveDebug(cliConfig.sequencerEnclaveDebug),
launcher.WithEdgelessDBDockerImage(cliConfig.edgelessDBDockerImage),
launcher.IsSGXEnabled(cliConfig.isSGXEnabled),
),
)
err := testnet.Start()
Expand Down
16 changes: 16 additions & 0 deletions testnet/launcher/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ type Config struct {

validatorEnclaveDockerImage string
validatorEnclaveDebug bool

isSGXEnabled bool

edgelessDBDockerImage string
}

func NewTestnetConfig(opts ...Option) *Config {
Expand Down Expand Up @@ -45,3 +49,15 @@ func WithValidatorEnclaveDebug(b bool) Option {
c.validatorEnclaveDebug = b
}
}

func WithEdgelessDBDockerImage(s string) Option {
return func(c *Config) {
c.edgelessDBDockerImage = s
}
}

func IsSGXEnabled(b bool) Option {
return func(c *Config) {
c.isSGXEnabled = b
}
}
3 changes: 2 additions & 1 deletion testnet/launcher/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ func (t *Testnet) Start() error {
node.WithNodeName("sequencer"),
node.WithNodeType("sequencer"),
node.WithGenesis(true),
node.WithSGXEnabled(false),
node.WithSGXEnabled(t.cfg.isSGXEnabled),
node.WithEnclaveImage(t.cfg.sequencerEnclaveDockerImage),
node.WithEnclaveDebug(t.cfg.sequencerEnclaveDebug),
node.WithHostImage("testnetobscuronet.azurecr.io/obscuronet/host:latest"),
node.WithEdgelessDBImage(t.cfg.edgelessDBDockerImage),
node.WithL1Host("eth2network"),
node.WithL1WSPort(9000),
node.WithEnclaveWSPort(11000),
Expand Down