Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
d933e905
Unverified
Commit
d933e905
authored
Jan 16, 2025
by
Yann Hodique
Committed by
GitHub
Jan 16, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(kurtosis-devnet): expose the devnet features (#13802)
parent
316ed4b4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
4 deletions
+32
-4
deployment.go
kurtosis-devnet/pkg/descriptors/deployment.go
+2
-0
kurtosis.go
kurtosis-devnet/pkg/kurtosis/kurtosis.go
+2
-1
spec.go
kurtosis-devnet/pkg/kurtosis/sources/spec/spec.go
+28
-3
No files found.
kurtosis-devnet/pkg/descriptors/deployment.go
View file @
d933e905
...
...
@@ -49,4 +49,6 @@ type WalletMap map[string]Wallet
type
DevnetEnvironment
struct
{
L1
*
Chain
`json:"l1"`
L2
[]
*
Chain
`json:"l2"`
Features
[]
string
`json:"features,omitempty"`
}
kurtosis-devnet/pkg/kurtosis/kurtosis.go
View file @
d933e905
...
...
@@ -163,7 +163,8 @@ func (d *KurtosisDeployer) GetEnvironmentInfo(ctx context.Context, spec *spec.En
env
:=
&
KurtosisEnvironment
{
DevnetEnvironment
:
descriptors
.
DevnetEnvironment
{
L2
:
make
([]
*
descriptors
.
Chain
,
0
,
len
(
spec
.
Chains
)),
L2
:
make
([]
*
descriptors
.
Chain
,
0
,
len
(
spec
.
Chains
)),
Features
:
spec
.
Features
,
},
}
...
...
kurtosis-devnet/pkg/kurtosis/sources/spec/spec.go
View file @
d933e905
...
...
@@ -15,7 +15,8 @@ type ChainSpec struct {
// EnclaveSpec represents the parsed chain specifications from the YAML
type
EnclaveSpec
struct
{
Chains
[]
ChainSpec
Chains
[]
ChainSpec
Features
[]
string
}
// NetworkParams represents the network parameters section in the YAML
...
...
@@ -29,9 +30,15 @@ type ChainConfig struct {
NetworkParams
NetworkParams
`yaml:"network_params"`
}
// InteropConfig represents the interop section in the YAML
type
InteropConfig
struct
{
Enabled
bool
`yaml:"enabled"`
}
// OptimismPackage represents the optimism_package section in the YAML
type
OptimismPackage
struct
{
Chains
[]
ChainConfig
`yaml:"chains"`
Interop
InteropConfig
`yaml:"interop"`
Chains
[]
ChainConfig
`yaml:"chains"`
}
// YAMLSpec represents the root of the YAML document
...
...
@@ -51,6 +58,16 @@ func NewSpec(opts ...SpecOption) *Spec {
return
s
}
type
featureExtractor
func
(
YAMLSpec
,
string
)
bool
var
featuresMap
=
map
[
string
]
featureExtractor
{
"interop"
:
interopExtractor
,
}
func
interopExtractor
(
yamlSpec
YAMLSpec
,
chainName
string
)
bool
{
return
yamlSpec
.
OptimismPackage
.
Interop
.
Enabled
}
// ExtractData parses a YAML document and returns the chain specifications
func
(
s
*
Spec
)
ExtractData
(
r
io
.
Reader
)
(
*
EnclaveSpec
,
error
)
{
var
yamlSpec
YAMLSpec
...
...
@@ -59,8 +76,16 @@ func (s *Spec) ExtractData(r io.Reader) (*EnclaveSpec, error) {
return
nil
,
fmt
.
Errorf
(
"failed to decode YAML: %w"
,
err
)
}
var
features
[]
string
for
feature
,
extractor
:=
range
featuresMap
{
if
extractor
(
yamlSpec
,
feature
)
{
features
=
append
(
features
,
feature
)
}
}
result
:=
&
EnclaveSpec
{
Chains
:
make
([]
ChainSpec
,
0
,
len
(
yamlSpec
.
OptimismPackage
.
Chains
)),
Chains
:
make
([]
ChainSpec
,
0
,
len
(
yamlSpec
.
OptimismPackage
.
Chains
)),
Features
:
features
,
}
// Extract chain specifications
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment