Skip to content

Commit

Permalink
Merge branch 'master' into tarak/6354-keygen-update
Browse files Browse the repository at this point in the history
  • Loading branch information
tarakby committed Feb 10, 2023
2 parents 92ed23d + 455e4a3 commit 6e1351d
Show file tree
Hide file tree
Showing 706 changed files with 33,147 additions and 18,228 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
- name: Use benchstat for comparison
run: |
export PATH=$PATH:$(go env GOPATH)/bin
go install golang.org/x/perf/cmd/benchstat@latest
go install golang.org/x/perf/cmd/benchstat@91a04616dc65ba76dbe9e5cf746b923b1402d303
echo "BENCHSTAT<<EOF" >> $GITHUB_ENV
echo "$(benchstat -html -sort delta old.txt new.txt | sed '/<title/,/<\/style>/d' | sed 's/<!doctype html>//g')" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/tools.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build Tools

on:
workflow_dispatch:
inputs:
tag:
description: 'Tagged commit to build tools against'
required: true
type: string
promote:
description: 'Should this build be promoted to the official boot-tools?'
required: false
type: boolean

jobs:
build-publish:
name: Build boot tools
runs-on: ubuntu-latest
steps:
- id: auth
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.GCR_SERVICE_KEY }} # TODO: we need a new key to allow uploads
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.19'
- name: Set up Google Cloud SDK
uses: google-github-actions/setup-gcloud@v1
with:
project_id: flow
- name: Checkout repo
uses: actions/checkout@v2
with:
ref: ${{ inputs.tag }}
- name: Build relic
run: make crypto_setup_gopath
- name: Build and upload boot-tools
run: |
make tool-bootstrap tool-transit
mkdir boot-tools
mv bootstrap transit boot-tools/
tar -czf boot-tools.tar ./boot-tools/
gsutil cp boot-tools.tar gs://flow-genesis-bootstrap/tools/${{ inputs.tag }}/boot-tools.tar
- name: Build and upload util
run: |
make tool-util
tar -czf util.tar util
gsutil cp util.tar gs://flow-genesis-bootstrap/tools/${{ inputs.tag }}/util.tar
- name: Promote boot-tools
run: |
if [[ "${{ inputs.promote }}" = true ]]; then
echo "promoting boot-tools.tar"
gsutil cp boot-tools.tar gs://flow-genesis-bootstrap/boot-tools.tar
else
echo "not promoting boot-tools.tar"
fi
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ cmd/collection/collection:
cmd/util/util:
go build -o cmd/util/util --tags relic cmd/util/main.go

.PHONY: update-core-contracts-version
update-core-contracts-version:
./scripts/update-core-contracts.sh $(CC_VERSION)

############################################################################################
# CAUTION: DO NOT MODIFY THESE TARGETS! DOING SO WILL BREAK THE FLAKY TEST MONITOR

Expand Down Expand Up @@ -151,6 +155,7 @@ generate-mocks: install-mock-generators
mockery --name '.*' --dir="state/protocol/events" --case=underscore --output="./state/protocol/events/mock" --outpkg="mock"
mockery --name '.*' --dir=engine/execution/computation/computer --case=underscore --output="./engine/execution/computation/computer/mock" --outpkg="mock"
mockery --name '.*' --dir=engine/execution/state --case=underscore --output="./engine/execution/state/mock" --outpkg="mock"
mockery --name '.*' --dir=engine/collection --case=underscore --output="./engine/collection/mock" --outpkg="mock"
mockery --name '.*' --dir=engine/consensus --case=underscore --output="./engine/consensus/mock" --outpkg="mock"
mockery --name '.*' --dir=engine/consensus/approvals --case=underscore --output="./engine/consensus/approvals/mock" --outpkg="mock"
rm -rf ./fvm/environment/mock
Expand Down Expand Up @@ -336,7 +341,7 @@ docker-build-access-debug:
docker build -f cmd/Dockerfile --build-arg TARGET=./cmd/access --build-arg COMMIT=$(COMMIT) --build-arg VERSION=$(IMAGE_TAG) --build-arg GOARCH=$(GOARCH) --target debug \
-t "$(CONTAINER_REGISTRY)/access-debug:latest" -t "$(CONTAINER_REGISTRY)/access-debug:$(SHORT_COMMIT)" -t "$(CONTAINER_REGISTRY)/access-debug:$(IMAGE_TAG)" .

# build corrupted access node for BFT testing
# build corrupt access node for BFT testing
.PHONY: docker-build-access-corrupt
docker-build-access-corrupt:
#temporarily make insecure/ a non-module to allow Docker to use corrupt builders there
Expand Down Expand Up @@ -551,7 +556,7 @@ docker-all-tools: tool-util tool-remove-execution-fork

PHONY: docker-build-util
docker-build-util:
docker build -f cmd/Dockerfile --ssh default --build-arg TARGET=./cmd/util --build-arg GOARCH=$(GOARCH) --target production \
docker build -f cmd/Dockerfile --build-arg TARGET=./cmd/util --build-arg GOARCH=$(GOARCH) --target production \
-t "$(CONTAINER_REGISTRY)/util:latest" -t "$(CONTAINER_REGISTRY)/util:$(SHORT_COMMIT)" -t "$(CONTAINER_REGISTRY)/util:$(IMAGE_TAG)" .

PHONY: tool-util
Expand Down
4 changes: 2 additions & 2 deletions access/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ func (h *Handler) GetExecutionResultForBlockID(ctx context.Context, req *access.
func (h *Handler) blockResponse(block *flow.Block, fullResponse bool, status flow.BlockStatus) (*access.BlockResponse, error) {
signerIDs, err := h.signerIndicesDecoder.DecodeSignerIDs(block.Header)
if err != nil {
return nil, err
return nil, err // the block was retrieved from local storage - so no errors are expected
}

var msg *entities.Block
Expand All @@ -513,7 +513,7 @@ func (h *Handler) blockResponse(block *flow.Block, fullResponse bool, status flo
func (h *Handler) blockHeaderResponse(header *flow.Header, status flow.BlockStatus) (*access.BlockHeaderResponse, error) {
signerIDs, err := h.signerIndicesDecoder.DecodeSignerIDs(header)
if err != nil {
return nil, err
return nil, err // the block was retrieved from local storage - so no errors are expected
}

msg, err := convert.BlockHeaderToMessage(header, signerIDs)
Expand Down
14 changes: 9 additions & 5 deletions admin/commands/uploader/toggle_uploader.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@ import (

"github.com/onflow/flow-go/admin"
"github.com/onflow/flow-go/admin/commands"
"github.com/onflow/flow-go/engine/execution/computation"
"github.com/onflow/flow-go/engine/execution/ingestion/uploader"
)

var _ commands.AdminCommand = (*ToggleUploaderCommand)(nil)

type ToggleUploaderCommand struct{}
type ToggleUploaderCommand struct {
uploadManager *uploader.Manager
}

func (t *ToggleUploaderCommand) Handler(ctx context.Context, req *admin.CommandRequest) (interface{}, error) {
enabled := req.ValidatorData.(bool)
computation.SetUploaderEnabled(enabled)
t.uploadManager.SetEnabled(enabled)
return "ok", nil
}

Expand All @@ -30,6 +32,8 @@ func (t *ToggleUploaderCommand) Validator(req *admin.CommandRequest) error {
return nil
}

func NewToggleUploaderCommand() commands.AdminCommand {
return &ToggleUploaderCommand{}
func NewToggleUploaderCommand(uploadManager *uploader.Manager) commands.AdminCommand {
return &ToggleUploaderCommand{
uploadManager: uploadManager,
}
}
Loading

0 comments on commit 6e1351d

Please sign in to comment.