Skip to content

Commit cb437cd

Browse files
author
Victor Castell
authored
Merge pull request #147 from 0xPolygon/release/0.3.1
chore: release v0.3.1
2 parents 95cdb6a + ad87a4e commit cb437cd

34 files changed

+2924
-652
lines changed

.github/workflows/test-e2e.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
with:
7171
repository: 0xPolygon/kurtosis-cdk
7272
path: "kurtosis-cdk"
73-
ref: "v0.2.14"
73+
ref: "v0.2.15"
7474

7575
- name: Setup Bats and bats libs
7676
uses: bats-core/[email protected]
@@ -81,3 +81,22 @@ jobs:
8181
env:
8282
KURTOSIS_FOLDER: ${{ github.workspace }}/kurtosis-cdk
8383
BATS_LIB_PATH: /usr/lib/
84+
85+
- name: Dump enclave logs
86+
if: failure()
87+
run: kurtosis dump ./dump
88+
89+
- name: Generate archive name
90+
if: failure()
91+
run: |
92+
archive_name="dump_run_with_args_${{matrix.e2e-group}}_${{ github.run_id }}"
93+
echo "ARCHIVE_NAME=${archive_name}" >> "$GITHUB_ENV"
94+
echo "Generated archive name: ${archive_name}"
95+
kurtosis service exec cdk cdk-node-001 'cat /etc/cdk/cdk-node-config.toml' > ./dump/cdk-node-config.toml
96+
97+
- name: Upload logs
98+
if: failure()
99+
uses: actions/upload-artifact@v4
100+
with:
101+
name: ${{ env.ARCHIVE_NAME }}
102+
path: ./dump

aggregator/aggregator_test.go

Lines changed: 538 additions & 8 deletions
Large diffs are not rendered by default.

cmd/main.go

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ const (
1818
)
1919

2020
var (
21-
configFileFlag = cli.StringFlag{
21+
configFileFlag = cli.StringSliceFlag{
2222
Name: config.FlagCfg,
2323
Aliases: []string{"c"},
24-
Usage: "Configuration `FILE`",
24+
Usage: "Configuration file(s)",
2525
Required: true,
2626
}
2727
customNetworkFlag = cli.StringFlag{
@@ -43,6 +43,24 @@ var (
4343
Required: false,
4444
Value: cli.NewStringSlice(common.SEQUENCE_SENDER, common.AGGREGATOR, common.AGGORACLE, common.RPC),
4545
}
46+
saveConfigFlag = cli.StringFlag{
47+
Name: config.FlagSaveConfigPath,
48+
Aliases: []string{"s"},
49+
Usage: "Save final configuration into to the indicated path (name: cdk-node-config.toml)",
50+
Required: false,
51+
}
52+
disableDefaultConfigVars = cli.BoolFlag{
53+
Name: config.FlagDisableDefaultConfigVars,
54+
Aliases: []string{"d"},
55+
Usage: "Disable default configuration variables, all of them must be defined on config files",
56+
Required: false,
57+
}
58+
59+
allowDeprecatedFields = cli.BoolFlag{
60+
Name: config.FlagAllowDeprecatedFields,
61+
Usage: "Allow that config-files contains deprecated fields",
62+
Required: false,
63+
}
4664
)
4765

4866
func main() {
@@ -53,6 +71,9 @@ func main() {
5371
&configFileFlag,
5472
&yesFlag,
5573
&componentsFlag,
74+
&saveConfigFlag,
75+
&disableDefaultConfigVars,
76+
&allowDeprecatedFields,
5677
}
5778
app.Commands = []*cli.Command{
5879
{

cmd/run.go

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -150,20 +150,17 @@ func createAggregator(ctx context.Context, c config.Config, runMigrations bool)
150150
}
151151

152152
// READ CHAIN ID FROM POE SC
153-
l2ChainID, err := etherman.GetL2ChainID()
154-
if err != nil {
155-
logger.Fatal(err)
156-
}
157-
158-
st := newState(&c, l2ChainID, stateSQLDB)
159153

160-
c.Aggregator.ChainID = l2ChainID
154+
if c.Aggregator.ChainID == 0 {
155+
l2ChainID, err := etherman.GetL2ChainID()
156+
if err != nil {
157+
logger.Fatal(err)
158+
}
159+
log.Infof("Autodiscover L2ChainID: %d", l2ChainID)
160+
c.Aggregator.ChainID = l2ChainID
161+
}
161162

162-
// Populate Network config
163-
c.Aggregator.Synchronizer.Etherman.Contracts.GlobalExitRootManagerAddr =
164-
c.NetworkConfig.L1Config.GlobalExitRootManagerAddr
165-
c.Aggregator.Synchronizer.Etherman.Contracts.RollupManagerAddr = c.NetworkConfig.L1Config.RollupManagerAddr
166-
c.Aggregator.Synchronizer.Etherman.Contracts.ZkEVMAddr = c.NetworkConfig.L1Config.ZkEVMAddr
163+
st := newState(&c, c.Aggregator.ChainID, stateSQLDB)
167164

168165
aggregator, err := aggregator.New(ctx, c.Aggregator, logger, st, etherman)
169166
if err != nil {

0 commit comments

Comments
 (0)