Skip to content
Merged
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
4 changes: 4 additions & 0 deletions .github/env/90-project.env
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,7 @@ MAGE_X_CVE_EXCLUDES=CVE-2024-38513,CVE-2023-45142,CVE-2025-64702,CVE-2021-43668,
# GO-2024-3218: Content Censorship in IPFS via Kademlia DHT abuse in github.com/libp2p/go-libp2p-kad-dht
# More info: https://pkg.go.dev/vuln/GO-2024-3218
# Module: github.com/libp2p/go-libp2p-kad-dht@v0.35.1

# CVE-2025-15558 for docker/compose/v2 (Windows-only Docker CLI plugin path vulnerability)
# Affects only Windows hosts; not applicable to Linux CI/production environments.
# Transitive dependency, cannot be upgraded independently.
6 changes: 4 additions & 2 deletions arcade.go
Original file line number Diff line number Diff line change
Expand Up @@ -519,8 +519,10 @@ func (a *Arcade) extractMinimalPath(fullPath *transaction.MerklePath, txOffset u

offset := txOffset
for level := 0; level < len(fullPath.Path); level++ {
if leaf := fullPath.FindLeafByOffset(level, offset); leaf != nil {
mp.AddLeaf(level, leaf)
if level == 0 {
if leaf := fullPath.FindLeafByOffset(level, offset); leaf != nil {
mp.AddLeaf(level, leaf)
}
}
if sibling := fullPath.FindLeafByOffset(level, offset^1); sibling != nil {
mp.AddLeaf(level, sibling)
Expand Down
6 changes: 4 additions & 2 deletions config/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ type Services struct {
WebhookHandler *handlers.WebhookHandler
Logger *slog.Logger
Config *Config
ownsP2PClient bool
}

// Initialize creates and returns all application services.
Expand Down Expand Up @@ -286,6 +287,7 @@ func (c *Config) initializeEmbedded(ctx context.Context, logger *slog.Logger, ch
WebhookHandler: webhookHandler,
Logger: logger,
Config: c,
ownsP2PClient: ownsP2PClient,
}, nil
}

Expand Down Expand Up @@ -316,8 +318,8 @@ func (s *Services) Close() error {
}
}

// Close P2P client (also stops Chaintracks via context)
if s.P2PClient != nil {
// Close P2P client only if we created it (caller owns it otherwise)
if s.P2PClient != nil && s.ownsP2PClient {
if err := s.P2PClient.Close(); err != nil {
errs = append(errs, fmt.Errorf("p2p client close: %w", err))
}
Expand Down
23 changes: 12 additions & 11 deletions docs/docs.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// Package docs Code generated by swaggo/swag. DO NOT EDIT
//
//nolint:gochecknoglobals,gochecknoinits // generated file
package docs

import "github.com/swaggo/swag"
Expand Down Expand Up @@ -164,13 +162,13 @@ const docTemplate = `{
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/errors.ErrorFields"
"$ref": "#/definitions/arcerrors.ErrorFields"
}
},
"465": {
"description": "ARC validation error",
"schema": {
"$ref": "#/definitions/errors.ErrorFields"
"$ref": "#/definitions/arcerrors.ErrorFields"
}
},
"500": {
Expand Down Expand Up @@ -214,10 +212,7 @@ const docTemplate = `{
"404": {
"description": "Not Found",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
"$ref": "#/definitions/arcerrors.ErrorFields"
}
},
"500": {
Expand Down Expand Up @@ -302,21 +297,21 @@ const docTemplate = `{
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/errors.ErrorFields"
"$ref": "#/definitions/arcerrors.ErrorFields"
}
},
"465": {
"description": "ARC validation error",
"schema": {
"$ref": "#/definitions/errors.ErrorFields"
"$ref": "#/definitions/arcerrors.ErrorFields"
}
}
}
}
}
},
"definitions": {
"errors.ErrorFields": {
"arcerrors.ErrorFields": {
"type": "object",
"properties": {
"detail": {
Expand Down Expand Up @@ -414,6 +409,9 @@ const docTemplate = `{
"type": "integer"
}
},
"status": {
"type": "integer"
},
"timestamp": {
"type": "string"
},
Expand All @@ -437,6 +435,8 @@ const docTemplate = `{
}`

// SwaggerInfo holds exported Swagger Info so clients can modify it
//
//nolint:gochecknoglobals // auto-generated by swaggo
var SwaggerInfo = &swag.Spec{
Version: "0.1.0",
Host: "",
Expand All @@ -450,6 +450,7 @@ var SwaggerInfo = &swag.Spec{
RightDelim: "}}",
}

//nolint:gochecknoinits // auto-generated by swaggo
func init() {
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}
Loading
Loading