Skip to content

Commit 3bdba3b

Browse files
committed
Merge branch 'master' into leo/refactor-index-result
2 parents 544f78d + 2f004ef commit 3bdba3b

File tree

134 files changed

+9275
-5612
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+9275
-5612
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: "CodeQL Analysis"
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
branches:
8+
- master
9+
schedule:
10+
- cron: '0 0 * * *'
11+
jobs:
12+
analyze-code:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
actions: read
16+
contents: read
17+
security-events: write
18+
pull-requests: write
19+
20+
env:
21+
GOPRIVATE: "github.com/onflow, github.com/axiomzen"
22+
# ORG_READER_PAT: ${{ secrets.ORG_READER_PAT }}
23+
# ORG_READER_USERNAME: ${{ secrets.ORG_READER_USERNAME }}
24+
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
languages: ['go']
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v4
32+
33+
- name: Setup Go
34+
uses: actions/setup-go@v4
35+
with:
36+
go-version-file: ./go.mod
37+
38+
# - name: set credentials for private repos
39+
# run: rm -f ~/.gitconfig && git config --global url.https://$ORG_READER_USERNAME:[email protected]/.insteadOf https://github.com/ && cat ~/.gitconfig
40+
41+
- name: Tidy Go and mod vendor
42+
run: go mod tidy && go mod vendor
43+
44+
45+
- name: Initialize CodeQL
46+
uses: github/codeql-action/init@v3
47+
with:
48+
languages: ${{ matrix.languages}}
49+
queries: security-extended
50+
51+
- name: Build
52+
run: CGO_ENABLED=0 go build -mod=vendor -tags=no_cgo ./...
53+
54+
- name: CodeQL Analyze
55+
uses: github/codeql-action/analyze@v3
56+
with:
57+
category: "/language:${{ matrix.languages}}"
58+
# need org username and pat to access private libraries
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Dependency Review Action
2+
3+
# PRs introducing NEW known-vulnerable packages will be blocked from merging.
4+
# This will output a GHAS comment in the PR with the details of the vulnerabilities.
5+
# and will also provide a comment on what to do next.
6+
7+
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
8+
name: "Dependency review"
9+
on:
10+
pull_request:
11+
branches: ["master"]
12+
13+
permissions:
14+
contents: read
15+
pull-requests: write # Required for PR comments
16+
17+
jobs:
18+
dependency-review:
19+
runs-on: ubuntu-latest
20+
outputs:
21+
vulnerable-changes: ${{ steps.review.outputs.vulnerable-changes }}
22+
steps:
23+
- name: "Checkout repository"
24+
uses: actions/checkout@v4
25+
- name: "Dependency Review"
26+
id: review
27+
uses: actions/dependency-review-action@v4
28+
with:
29+
comment-summary-in-pr: always
30+
fail-on-severity: moderate
31+
#allow-ghsas: GHSA-q34m-jh98-gwm2,GHSA-f9vj-2wh5-fj8j EXAMPLE of how to whitelist!
32+
33+
dependency-review-failure-info:
34+
needs: dependency-review
35+
if: failure()
36+
runs-on: ubuntu-latest
37+
steps:
38+
- name: Add PR Comment
39+
uses: actions/github-script@v7
40+
env:
41+
VULN_OUTPUT: ${{ needs.dependency-review.outputs.vulnerable-changes }}
42+
with:
43+
script: |
44+
try {
45+
const vulnData = JSON.parse(process.env.VULN_OUTPUT || '[]');
46+
let details = '';
47+
48+
for (const pkg of vulnData) {
49+
details += `\n📦 **${pkg.name}@${pkg.version}**\n`;
50+
}
51+
52+
const comment = `⚠️ **Security Dependency Review Failed** ⚠️
53+
54+
This pull request introduces dependencies with security vulnerabilities of moderate severity or higher.
55+
56+
### Vulnerable Dependencies:${details}
57+
58+
### What to do next?
59+
1. Review the vulnerability details in the Dependency Review Comment above, specifically the "Vulnerabilities" section
60+
2. Click on the links in the "Vulnerability" section to see the details of the vulnerability
61+
3. If multiple versions of the same package are vulnerable, please update to the common latest non-vulnerable version
62+
4. If you are unsure about the vulnerability, please contact the security engineer
63+
5. If the vulnerability cannot be avoided (can't upgrade, or need to keep), contact #security on slack to **get it added to the allowlist**
64+
\nSecurity Engineering contact: #security on slack`;
65+
66+
await github.rest.issues.createComment({
67+
issue_number: context.issue.number,
68+
owner: context.repo.owner,
69+
repo: context.repo.repo,
70+
body: comment
71+
});
72+
} catch (error) {
73+
console.error('Error processing vulnerability data:', error);
74+
throw error;
75+
}

.mockery.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ packages:
2222
config:
2323
dir: "consensus/hotstuff/mocks"
2424
outpkg: "mocks"
25+
github.com/onflow/flow-go/engine/access/ingestion/collections:
2526
github.com/onflow/flow-go/engine/access/ingestion/tx_error_messages:
2627
github.com/onflow/flow-go/engine/access/rest/common/models:
2728
github.com/onflow/flow-go/engine/access/rest/websockets:
@@ -31,7 +32,6 @@ packages:
3132
github.com/onflow/flow-go/engine/access/rpc/backend/node_communicator:
3233
github.com/onflow/flow-go/engine/access/rpc/backend/transactions/error_messages:
3334
github.com/onflow/flow-go/engine/access/rpc/backend/transactions/provider:
34-
github.com/onflow/flow-go/engine/access/rpc/backend/transactions/retrier:
3535
github.com/onflow/flow-go/engine/access/rpc/connection:
3636
github.com/onflow/flow-go/engine/access/state_stream:
3737
github.com/onflow/flow-go/engine/access/subscription:

access/api.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ type TransactionsAPI interface {
5959

6060
GetSystemTransaction(ctx context.Context, txID flow.Identifier, blockID flow.Identifier) (*flow.TransactionBody, error)
6161
GetSystemTransactionResult(ctx context.Context, txID flow.Identifier, blockID flow.Identifier, encodingVersion entities.EventEncodingVersion) (*accessmodel.TransactionResult, error)
62+
63+
GetScheduledTransaction(ctx context.Context, scheduledTxID uint64) (*flow.TransactionBody, error)
64+
GetScheduledTransactionResult(ctx context.Context, scheduledTxID uint64, encodingVersion entities.EventEncodingVersion) (*accessmodel.TransactionResult, error)
6265
}
6366

6467
type TransactionStreamAPI interface {

access/mock/api.go

Lines changed: 60 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

access/mock/transactions_api.go

Lines changed: 60 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)