From c73d0323cdbf005740da5f5bbc55b4e0f51e6d81 Mon Sep 17 00:00:00 2001 From: MauroFab Date: Wed, 24 Apr 2024 14:58:33 -0300 Subject: [PATCH 01/15] Add ci --- .github/workflows/build.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..8497f8e19 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,30 @@ +on: + push: + branches: + - master + pull_request: + branches: + - master + +name: build +jobs: + build-and-lint: + runs-on: ubuntu-latest + steps: + - name: Install Go + uses: actions/setup-go@v3 + with: + go-version: 1.22 + - name: Checkout code + uses: actions/checkout@v2 + - name: Build aggregator + run: go build aggregator/cmd/main.go + - name: Build operator + run: go build operator/cmd/main.go + - name: Build task sender + run: go build operator/cmd/main.go + - name: Run linters + uses: golangci/golangci-lint-action@v3 + with: + version: v1.46.2 + \ No newline at end of file From 52f8116a6c962278a1c49a9753f8eb91e42d0fc9 Mon Sep 17 00:00:00 2001 From: MauroFab Date: Wed, 24 Apr 2024 15:01:21 -0300 Subject: [PATCH 02/15] Edit ci --- .github/workflows/build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8497f8e19..b137d9f4a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,12 +1,12 @@ +name: Build-Go + on: + merge_group: push: - branches: - - master + branches: [main] pull_request: - branches: - - master + branches: ["*"] -name: build jobs: build-and-lint: runs-on: ubuntu-latest From fcc49cd0ce239b679f7650b385ad32f6cc6b5634 Mon Sep 17 00:00:00 2001 From: MauroFab Date: Wed, 24 Apr 2024 15:11:37 -0300 Subject: [PATCH 03/15] Test lint --- .github/workflows/build.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b137d9f4a..76df59fb7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,11 +10,17 @@ on: jobs: build-and-lint: runs-on: ubuntu-latest + steps: - - name: Install Go - uses: actions/setup-go@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: 1.22 + go-version: '1.22' + cache: false + - name: golangci-lint + uses: golangci/golangci-lint-action@v4 + with: + version: v1.54 - name: Checkout code uses: actions/checkout@v2 - name: Build aggregator From 6992473d82e137c1510e6f91924ca50f03b84ba5 Mon Sep 17 00:00:00 2001 From: MauroFab Date: Wed, 24 Apr 2024 15:21:24 -0300 Subject: [PATCH 04/15] Add yaml config --- .golangci.yaml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .golangci.yaml diff --git a/.golangci.yaml b/.golangci.yaml new file mode 100644 index 000000000..eb96dd953 --- /dev/null +++ b/.golangci.yaml @@ -0,0 +1,7 @@ +output: + formats: + - format: colored-line-number + path: stderr + - format: github-actions + path: stderr + From 09f64a31fc0381921f9f5ae0b8a47a3e3d347d04 Mon Sep 17 00:00:00 2001 From: MauroFab Date: Wed, 24 Apr 2024 15:24:33 -0300 Subject: [PATCH 05/15] Add yaml config --- .golangci.yml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .golangci.yml diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 000000000..eb96dd953 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,7 @@ +output: + formats: + - format: colored-line-number + path: stderr + - format: github-actions + path: stderr + From 6ed22a21f991a2649c282bee3e45cde076a78a9c Mon Sep 17 00:00:00 2001 From: MauroFab Date: Wed, 24 Apr 2024 15:27:18 -0300 Subject: [PATCH 06/15] Add yaml config --- .golangci.yaml | 7 ------- .golangci.yml | 57 ++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 53 insertions(+), 11 deletions(-) delete mode 100644 .golangci.yaml diff --git a/.golangci.yaml b/.golangci.yaml deleted file mode 100644 index eb96dd953..000000000 --- a/.golangci.yaml +++ /dev/null @@ -1,7 +0,0 @@ -output: - formats: - - format: colored-line-number - path: stderr - - format: github-actions - path: stderr - diff --git a/.golangci.yml b/.golangci.yml index eb96dd953..b6b87a4fa 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,7 +1,56 @@ +# output configuration options output: + # The formats used to render issues. + # Format: `colored-line-number`, `line-number`, `json`, `colored-tab`, `tab`, `checkstyle`, `code-climate`, `junit-xml`, `github-actions`, `teamcity` + # Output path can be either `stdout`, `stderr` or path to the file to write to. + # + # For the CLI flag (`--out-format`), multiple formats can be specified by separating them by comma. + # The output can be specified for each of them by separating format name and path by colon symbol. + # Example: "--out-format=checkstyle:report.xml,json:stdout,colored-line-number" + # The CLI flag (`--out-format`) override the configuration file. + # + # Default: + # formats: + # - format: colored-line-number + # path: stdout formats: - - format: colored-line-number - path: stderr - - format: github-actions + - format: json path: stderr - + - format: checkstyle + path: report.xml + - format: colored-line-number + # Print lines of code with issue. + # Default: true + print-issued-lines: false + # Print linter name in the end of issue text. + # Default: true + print-linter-name: false + # Make issues output unique by line. + # Default: true + uniq-by-line: false + # Add a prefix to the output file references. + # Default: "" + path-prefix: "" + # Sort results by the order defined in `sort-order`. + # Default: false + sort-results: true + # Order to use when sorting results. + # Require `sort-results` to `true`. + # Possible values: `file`, `linter`, and `severity`. + # + # If the severity values are inside the following list, they are ordered in this order: + # 1. error + # 2. warning + # 3. high + # 4. medium + # 5. low + # Either they are sorted alphabetically. + # + # Default: ["file"] + sort-order: + - linter + - severity + - file # filepath, line, and column. + # Show statistics per linter. + # Default: false + show-stats: true From b9696dd76efb71b7350b39f15c40b5c176bf2119 Mon Sep 17 00:00:00 2001 From: MauroFab Date: Wed, 24 Apr 2024 15:58:46 -0300 Subject: [PATCH 07/15] Remove yml --- .golangci.yml | 56 --------------------------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 .golangci.yml diff --git a/.golangci.yml b/.golangci.yml deleted file mode 100644 index b6b87a4fa..000000000 --- a/.golangci.yml +++ /dev/null @@ -1,56 +0,0 @@ -# output configuration options -output: - # The formats used to render issues. - # Format: `colored-line-number`, `line-number`, `json`, `colored-tab`, `tab`, `checkstyle`, `code-climate`, `junit-xml`, `github-actions`, `teamcity` - # Output path can be either `stdout`, `stderr` or path to the file to write to. - # - # For the CLI flag (`--out-format`), multiple formats can be specified by separating them by comma. - # The output can be specified for each of them by separating format name and path by colon symbol. - # Example: "--out-format=checkstyle:report.xml,json:stdout,colored-line-number" - # The CLI flag (`--out-format`) override the configuration file. - # - # Default: - # formats: - # - format: colored-line-number - # path: stdout - formats: - - format: json - path: stderr - - format: checkstyle - path: report.xml - - format: colored-line-number - # Print lines of code with issue. - # Default: true - print-issued-lines: false - # Print linter name in the end of issue text. - # Default: true - print-linter-name: false - # Make issues output unique by line. - # Default: true - uniq-by-line: false - # Add a prefix to the output file references. - # Default: "" - path-prefix: "" - # Sort results by the order defined in `sort-order`. - # Default: false - sort-results: true - # Order to use when sorting results. - # Require `sort-results` to `true`. - # Possible values: `file`, `linter`, and `severity`. - # - # If the severity values are inside the following list, they are ordered in this order: - # 1. error - # 2. warning - # 3. high - # 4. medium - # 5. low - # Either they are sorted alphabetically. - # - # Default: ["file"] - sort-order: - - linter - - severity - - file # filepath, line, and column. - # Show statistics per linter. - # Default: false - show-stats: true From 84d75f432638b2f95ba2a5f1c8b96bc8b81dfd8a Mon Sep 17 00:00:00 2001 From: MauroFab Date: Wed, 24 Apr 2024 16:10:56 -0300 Subject: [PATCH 08/15] Add build --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 76df59fb7..206229bdc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,4 +33,3 @@ jobs: uses: golangci/golangci-lint-action@v3 with: version: v1.46.2 - \ No newline at end of file From a5b6352c64a2a1e5b954c27848326840be0e9866 Mon Sep 17 00:00:00 2001 From: MauroFab Date: Wed, 24 Apr 2024 16:12:34 -0300 Subject: [PATCH 09/15] Fix lint --- core/chainio/avs_writer.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/chainio/avs_writer.go b/core/chainio/avs_writer.go index 0868a7c26..15725bc29 100644 --- a/core/chainio/avs_writer.go +++ b/core/chainio/avs_writer.go @@ -30,8 +30,18 @@ func NewAvsWriterFromConfig(c *config.Config) (*AvsWriter, error) { clients, err := clients.BuildAll(buildAllConfig, c.EcdsaPrivateKey, c.Logger) + if err != nil { + c.Logger.Error("Cannot build signer config", "err", err) + return nil, err + } + avsServiceBindings, err := NewAvsServiceBindings(c.AlignedLayerServiceManagerAddr, c.AlignedLayerOperatorStateRetrieverAddr, c.EthHttpClient, c.Logger) + if err != nil { + c.Logger.Error("Cannot create avs service bindings", "err", err) + return nil, err + } + privateKeySigner, err := signer.NewPrivateKeySigner(c.EcdsaPrivateKey, c.ChainId) if err != nil { From dcad6b14415d8d8c566e8a4d0162d9bf3cd9abf2 Mon Sep 17 00:00:00 2001 From: Mauro Toscano <12560266+MauroToscano@users.noreply.github.com> Date: Wed, 24 Apr 2024 17:03:44 -0300 Subject: [PATCH 10/15] Update .github/workflows/build.yml Co-authored-by: Mariano A. Nicolini --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 206229bdc..908d72233 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ jobs: - name: Build operator run: go build operator/cmd/main.go - name: Build task sender - run: go build operator/cmd/main.go + run: go build task_sender/cmd/main.go - name: Run linters uses: golangci/golangci-lint-action@v3 with: From 4cc9dbe9971ba2309f14cc7157e68f396e07eb8c Mon Sep 17 00:00:00 2001 From: MauroFab Date: Wed, 24 Apr 2024 17:10:37 -0300 Subject: [PATCH 11/15] Experiment --- .github/workflows/build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 908d72233..4f9f88d33 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,6 +6,9 @@ on: branches: [main] pull_request: branches: ["*"] + +permissions: + contents: read jobs: build-and-lint: @@ -15,7 +18,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: '1.22' + go-version: '1.21' cache: false - name: golangci-lint uses: golangci/golangci-lint-action@v4 From 1d5367add35900fe95cde331e2deea4739ba3573 Mon Sep 17 00:00:00 2001 From: MauroFab Date: Wed, 24 Apr 2024 17:17:26 -0300 Subject: [PATCH 12/15] Split lint build --- .github/workflows/build.yml | 10 +------ .github/workflows/lint.yml | 55 +++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4f9f88d33..d43f7edcd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,7 +6,7 @@ on: branches: [main] pull_request: branches: ["*"] - + permissions: contents: read @@ -20,10 +20,6 @@ jobs: with: go-version: '1.21' cache: false - - name: golangci-lint - uses: golangci/golangci-lint-action@v4 - with: - version: v1.54 - name: Checkout code uses: actions/checkout@v2 - name: Build aggregator @@ -32,7 +28,3 @@ jobs: run: go build operator/cmd/main.go - name: Build task sender run: go build task_sender/cmd/main.go - - name: Run linters - uses: golangci/golangci-lint-action@v3 - with: - version: v1.46.2 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000..6ef424472 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,55 @@ +name: golangci-lint +on: + push: + branches: + - master + - main + pull_request: + +permissions: + contents: read + # Optional: allow read access to pull request. Use with `only-new-issues` option. + # pull-requests: read + +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: '1.21' + cache: false + - name: golangci-lint + uses: golangci/golangci-lint-action@v4 + with: + # Require: The version of golangci-lint to use. + # When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version. + # When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit. + version: v1.54 + + # Optional: working directory, useful for monorepos + # working-directory: somedir + + # Optional: golangci-lint command line arguments. + # + # Note: By default, the `.golangci.yml` file should be at the root of the repository. + # The location of the configuration file can be changed by using `--config=` + # args: --timeout=30m --config=/my/path/.golangci.yml --issues-exit-code=0 + + # Optional: show only new issues if it's a pull request. The default value is `false`. + # only-new-issues: true + + # Optional: if set to true, then all caching functionality will be completely disabled, + # takes precedence over all other caching options. + # skip-cache: true + + # Optional: if set to true, then the action won't cache or restore ~/go/pkg. + # skip-pkg-cache: true + + # Optional: if set to true, then the action won't cache or restore ~/.cache/go-build. + # skip-build-cache: true + + # Optional: The mode to install golangci-lint. It can be 'binary' or 'goinstall'. + # install-mode: "goinstall" From 8b8bfc8beb44f77d606d114e9e8f60e3111c6413 Mon Sep 17 00:00:00 2001 From: MauroFab Date: Wed, 24 Apr 2024 17:18:04 -0300 Subject: [PATCH 13/15] Use canonical names --- .github/workflows/build.yml | 2 +- .github/workflows/{lint.yml => golangci-lint.yml} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{lint.yml => golangci-lint.yml} (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d43f7edcd..442354425 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Build-Go +name: build-go on: merge_group: diff --git a/.github/workflows/lint.yml b/.github/workflows/golangci-lint.yml similarity index 100% rename from .github/workflows/lint.yml rename to .github/workflows/golangci-lint.yml From 2e6e05ee4454da2ff303677d2724f81867113db9 Mon Sep 17 00:00:00 2001 From: MauroFab Date: Wed, 24 Apr 2024 17:19:53 -0300 Subject: [PATCH 14/15] Fix names --- .github/workflows/build.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 442354425..9fae56fab 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: build-go +name: build-go-projects on: merge_group: @@ -7,11 +7,8 @@ on: pull_request: branches: ["*"] -permissions: - contents: read - jobs: - build-and-lint: + build: runs-on: ubuntu-latest steps: From f382dd8ac3ed1735e6bc242ec141f00aa0f22251 Mon Sep 17 00:00:00 2001 From: MauroFab Date: Wed, 24 Apr 2024 17:20:15 -0300 Subject: [PATCH 15/15] Bump go version --- .github/workflows/build.yml | 2 +- .github/workflows/golangci-lint.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9fae56fab..4518a9678 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: '1.21' + go-version: '1.22' cache: false - name: Checkout code uses: actions/checkout@v2 diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 6ef424472..874751cbe 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: '1.21' + go-version: '1.22' cache: false - name: golangci-lint uses: golangci/golangci-lint-action@v4