Skip to content

Commit

Permalink
Merge branch 'master' into petera/allow-faster-view-times-testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanschalm authored Nov 13, 2024
2 parents df3e47a + acbc34f commit e0cc4c6
Show file tree
Hide file tree
Showing 655 changed files with 29,505 additions and 24,907 deletions.
1 change: 1 addition & 0 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ jobs:
docker-push:
name: ${{ matrix.role }} images
runs-on: ubuntu-latest
environment: Production Docker Registry
needs: matrix_builder

# setup jobs for each role
Expand Down
19 changes: 15 additions & 4 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
name: CD

on:
push:
tags:
- '*'
- "!daily-*"
# Workflow dispatch for now, while we're testing environments
# push:
# tags:
# - '*'
# - "!daily-*"
workflow_dispatch:
inputs:
tag:
description: 'Tag/commit'
required: true
type: string


env:
GO_VERSION: "1.22"
Expand All @@ -13,6 +21,7 @@ jobs:
docker-push:
name: Push to container registry
runs-on: ubuntu-latest
environment: Production Docker Registry
steps:
- name: Setup Go
uses: actions/setup-go@v4
Expand All @@ -21,6 +30,8 @@ jobs:
go-version: ${{ env.GO_VERSION }}
- name: Checkout repo
uses: actions/checkout@v2
with:
ref: ${{ inputs.tag }}
# Provide Google Service Account credentials to Github Action, allowing interaction with the Google Container Registry
# Logging in as [email protected]
- id: auth
Expand Down
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ linters-settings:
goimports:
# put imports beginning with prefix after 3rd-party packages;
# it's a comma-separated list of prefixes
local-prefixes: github.com/onflow/flow-go
local-prefixes: github.com/onflow/flow-go/

gosec:
# To select a subset of rules to run.
Expand Down
27 changes: 13 additions & 14 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
/engine/consensus/** @AlexHentschel @durkmurder @jordanschalm

# Execution Stream
/cmd/execution/** @ramtinms
/engine/execution/** @ramtinms
/cmd/execution/** @zhangchiqing
/engine/execution/** @zhangchiqing

# Access Stream
/access/** @peterargue
Expand All @@ -18,19 +18,18 @@
/engine/access/** @peterargue

# Verification Stream
/cmd/verification/** @ramtinms @yhassanzadeh13
/engine/verification/** @ramtinms @yhassanzadeh13
/module/chunking/** @ramtinms
/integration/tests/verification @ramtinms @yhassanzadeh13
/cmd/verification/** @zhangchiqing
/engine/verification/** @zhangchiqing
/integration/tests/verification @zhangchiqing

# Ledger Stream
/ledger/** @ramtinms @AlexHentschel
/ledger/** @AlexHentschel

# FVM Stream
/fvm/** @ramtinms @janezpodhostnik
/fvm/** @janezpodhostnik

# Networking Stream
/network/** @yhassanzadeh13
/network/** @Kay-Zee

# Cryptography Stream
/crypto/** @tarakby
Expand All @@ -39,13 +38,13 @@
/cmd/bootstrap/** @zhangchiqing

# Dev Tools Stream
.github/workflows/** @gomisha
/insecure/** @gomisha @yhassanzadeh13
/integration/benchnet2/** @gomisha
/tools/test_monitor/** @gomisha
.github/workflows/** @Kay-Zee
/insecure/** @Kay-Zee
/integration/benchnet2/** @Kay-Zee
/tools/test_monitor/** @Kay-Zee

# Performance Stream
/integration/benchmark/** @gomisha
/integration/benchmark/** @Kay-Zee

# Execution Sync
/module/executiondatasync/** @peterargue
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ go-math-rand-check:
# - "onflow/crypto/random" for deterministic randomness
grep --include=\*.go \
--exclude=*test* --exclude=*helper* --exclude=*example* --exclude=*fixture* --exclude=*benchmark* --exclude=*profiler* \
--exclude-dir=*test* --exclude-dir=*helper* --exclude-dir=*example* --exclude-dir=*fixture* --exclude-dir=*benchmark* --exclude-dir=*profiler* -rnw '"math/rand"'; \
--exclude-dir=*test* --exclude-dir=*helper* --exclude-dir=*example* --exclude-dir=*fixture* --exclude-dir=*benchmark* --exclude-dir=*profiler* --exclude-dir=*emulator* -rnw '"math/rand"'; \
if [ $$? -ne 1 ]; then \
echo "[Error] Go production code should not use math/rand package"; exit 1; \
fi
Expand Down Expand Up @@ -138,8 +138,8 @@ endif

.PHONY: generate-openapi
generate-openapi:
swagger-codegen generate -l go -i https://raw.githubusercontent.com/onflow/flow/master/openapi/access.yaml -D packageName=models,modelDocs=false,models -o engine/access/rest/models;
go fmt ./engine/access/rest/models
swagger-codegen generate -l go -i https://raw.githubusercontent.com/onflow/flow/master/openapi/access.yaml -D packageName=models,modelDocs=false,models -o engine/access/rest/http/models;
go fmt ./engine/access/rest/http/models

.PHONY: generate
generate: generate-proto generate-mocks generate-fvm-env-wrappers
Expand Down Expand Up @@ -857,7 +857,7 @@ docker-all-tools: tool-util tool-remove-execution-fork

PHONY: docker-build-util
docker-build-util:
docker build -f cmd/Dockerfile --build-arg TARGET=./cmd/util --build-arg GOARCH=$(GOARCH) --build-arg VERSION=$(IMAGE_TAG) --build-arg CGO_FLAG=$(CRYPTO_FLAG) --target production \
docker build -f cmd/Dockerfile --build-arg TARGET=./cmd/util --build-arg GOARCH=$(GOARCH) --build-arg VERSION=$(IMAGE_TAG) --build-arg CGO_FLAG=$(DISABLE_ADX) --target production \
-t "$(CONTAINER_REGISTRY)/util:latest" \
-t "$(CONTAINER_REGISTRY)/util:$(IMAGE_TAG)" .

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ The following table lists all work streams and links to their home directory and
## Installation

- Clone this repository
- Install [Go](https://golang.org/doc/install) (Flow supports Go 1.18 and later)
- Install [Go](https://golang.org/doc/install) (Flow requires Go 1.22 and later)
- Install [Docker](https://docs.docker.com/get-docker/), which is used for running a local network and integration tests
- Make sure the [`GOPATH`](https://golang.org/cmd/go/#hdr-GOPATH_environment_variable) and `GOBIN` environment variables
are set, and `GOBIN` is added to your path:
Expand Down
15 changes: 15 additions & 0 deletions access/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import (
// ErrUnknownReferenceBlock indicates that a transaction references an unknown block.
var ErrUnknownReferenceBlock = errors.New("unknown reference block")

// IndexReporterNotInitialized is returned when indexReporter is nil because
// execution data syncing and indexing is disabled
var IndexReporterNotInitialized = errors.New("index reported not initialized")

// IncompleteTransactionError indicates that a transaction is missing one or more required fields.
type IncompleteTransactionError struct {
MissingFields []string
Expand Down Expand Up @@ -115,3 +119,14 @@ func IsInsufficientBalanceError(err error) bool {
var balanceError InsufficientBalanceError
return errors.As(err, &balanceError)
}

// IndexedHeightFarBehindError indicates that a node is far behind on indexing.
type IndexedHeightFarBehindError struct {
SealedHeight uint64
IndexedHeight uint64
}

func (e IndexedHeightFarBehindError) Error() string {
return fmt.Sprintf("the difference between the latest sealed height (%d) and indexed height (%d) exceeds the maximum gap allowed",
e.SealedHeight, e.IndexedHeight)
}
8 changes: 6 additions & 2 deletions access/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1435,15 +1435,19 @@ func (h *Handler) SendAndSubscribeTransactionStatuses(
messageIndex := counters.NewMonotonousCounter(0)
return subscription.HandleSubscription(sub, func(txResults []*TransactionResult) error {
for i := range txResults {
value := messageIndex.Increment()
index := messageIndex.Value()
if ok := messageIndex.Set(index + 1); !ok {
return status.Errorf(codes.Internal, "message index already incremented to %d", messageIndex.Value())
}

err = stream.Send(&access.SendAndSubscribeTransactionStatusesResponse{
TransactionResults: TransactionResultToMessage(txResults[i]),
MessageIndex: value,
MessageIndex: index,
})
if err != nil {
return rpc.ConvertError(err, "could not send response", codes.Internal)
}

}

return nil
Expand Down
28 changes: 28 additions & 0 deletions access/mock/blocks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e0cc4c6

Please sign in to comment.