From 3f6be5e9f366f95256875354c1d97546886c620f Mon Sep 17 00:00:00 2001 From: Ullaakut Date: Thu, 23 Sep 2021 10:52:50 +0200 Subject: [PATCH] More fixes --- .github/.github/pull_request_template.md | 9 - .github/.github/workflows/ci.yml | 107 --------- .github/.github/workflows/release.yml | 97 -------- .github/workflows/ci.yml | 42 ++++ .github/workflows/release.yml | 33 +++ .gitignore | 1 + cmd/flow-rosetta-server/README.md | 51 ++++ cmd/flow-rosetta-server/exemptions.json | 20 ++ cmd/flow-rosetta-server/flow.json | 41 ++++ cmd/flow-rosetta-server/main.go | 236 +++++++++++++++++++ go.mod | 27 ++- go.sum | 26 +- models/convert/{convert => }/cadence.go | 0 models/convert/{convert => }/cadence_test.go | 0 models/convert/{convert => }/hash.go | 0 models/convert/{convert => }/hash_test.go | 0 models/convert/{convert => }/paths.go | 0 models/convert/{convert => }/paths_test.go | 0 models/convert/{convert => }/types.go | 0 models/convert/{convert => }/types_test.go | 0 models/convert/{convert => }/values.go | 0 models/convert/{convert => }/values_test.go | 0 22 files changed, 451 insertions(+), 239 deletions(-) delete mode 100755 .github/.github/pull_request_template.md delete mode 100755 .github/.github/workflows/ci.yml delete mode 100755 .github/.github/workflows/release.yml create mode 100755 cmd/flow-rosetta-server/README.md create mode 100755 cmd/flow-rosetta-server/exemptions.json create mode 100755 cmd/flow-rosetta-server/flow.json create mode 100755 cmd/flow-rosetta-server/main.go rename models/convert/{convert => }/cadence.go (100%) rename models/convert/{convert => }/cadence_test.go (100%) rename models/convert/{convert => }/hash.go (100%) rename models/convert/{convert => }/hash_test.go (100%) rename models/convert/{convert => }/paths.go (100%) rename models/convert/{convert => }/paths_test.go (100%) rename models/convert/{convert => }/types.go (100%) rename models/convert/{convert => }/types_test.go (100%) rename models/convert/{convert => }/values.go (100%) rename models/convert/{convert => }/values_test.go (100%) diff --git a/.github/.github/pull_request_template.md b/.github/.github/pull_request_template.md deleted file mode 100755 index dcf39c1..0000000 --- a/.github/.github/pull_request_template.md +++ /dev/null @@ -1,9 +0,0 @@ -## Goal of this PR - -Fixes # - -## Checklist - -- [ ] Is on the right branch -- [ ] Documentation is up-to-date -- [ ] Tests are up-to-date \ No newline at end of file diff --git a/.github/.github/workflows/ci.yml b/.github/.github/workflows/ci.yml deleted file mode 100755 index 1e4b9bc..0000000 --- a/.github/.github/workflows/ci.yml +++ /dev/null @@ -1,107 +0,0 @@ -name: CI - -# Continuous integration will run whenever a pull request for the master branch -# is created or updated. -on: - workflow_dispatch: - pull_request: - branches: - - master - -jobs: - check: - runs-on: ubuntu-latest - - steps: - - name: Check out source code - uses: actions/checkout@v2 - - - name: Check out FlowGo - uses: actions/checkout@v2 - with: - repository: onflow/flow-go - ref: c0afa789365eb7a22713ed76b8de1e3efaf3a70a - path: flow-go - - - name: Install Go - uses: actions/setup-go@v2 - with: - go-version: 1.17 - - - name: Cache Go modules - uses: actions/cache@v2 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - # Here, we simply print the exact go version, to have it as part of the - # action's output, which might be convenient. - - name: Print Go version - run: go version - - # The protobuf steps uses the official instructions to install the - # pre-compiled binary, see: - # https://grpc.io/docs/protoc-installation/#install-pre-compiled-binaries-any-os - - name: Install Protobuf compiler - run: | - PB_REL="https://github.com/protocolbuffers/protobuf/releases" - curl -LO $PB_REL/download/v3.17.3/protoc-3.17.3-linux-x86_64.zip - unzip protoc-3.17.3-linux-x86_64.zip -d $HOME/.local - export PATH="$PATH:$HOME/.local/bin" - git clean -fd - - # In order to be able to generate the protocol buffer and GRPC files, we - # need to install the related Go modules. - - name: Install Protobuf dependencies - run: | - go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26 - go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1 - go install github.com/srikrsna/protoc-gen-gotag@v0.6.1 - - # Since building relic takes some time, we want to cache it. - - name: Cache Crypto package - uses: actions/cache@v2 - with: - path: ./flow-go/crypto - key: ${{ runner.os }}-crypto - restore-keys: | - ${{ runner.os }}-crypto - - # In order to be able to build with flow-go and the relic tag, we need to - # run its go generate target. - - name: Install Flow Go's crypto - run: | - cd ./flow-go/crypto - go generate . - - # This check makes sure that the `go.mod` and `go.sum` files for Go - # modules are always up-to-date. - - name: Verify Go modules - run: go mod tidy && git status && git --no-pager diff && git diff-index --quiet HEAD -- - - # This check makes sure that the generated protocol buffer files in Go - # have been updated in case there was a change in the definitions. - - name: Verify generated files - run: go generate ./... && git status && git --no-pager diff && git diff-index --quiet HEAD -- - - # This check makes sure that the source code is formatted according to the - # Go standard `go fmt` formatting. - - name: Verify source code formatting - run: go fmt ./... && git status && git --no-pager diff && git diff-index --quiet HEAD -- - - # This check makes sure that we can compile the binary as a pure Go binary - # without CGO support. - - name: Verify compilation - run: go build -tags relic ./... - - # This check runs all unit tests with verbose output and ensures that all - # of the tests pass successfully. - - name: Verify unit tests - run: go test -tags relic -v ./... - - # This check runs all integration tests with verbose output and ensures - # that they pass successfully. - - name: Verify integration tests - run: go test -v -tags="relic integration" ./... diff --git a/.github/.github/workflows/release.yml b/.github/.github/workflows/release.yml deleted file mode 100755 index 05db0aa..0000000 --- a/.github/.github/workflows/release.yml +++ /dev/null @@ -1,97 +0,0 @@ -name: AutoRelease - -# AutoRelease will run whenever a tag is pushed. -on: - workflow_dispatch: - push: - tags: - - '*' - -jobs: - goreleaser: - runs-on: ubuntu-latest - steps: - - name: Checkout source code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Check out FlowGo - uses: actions/checkout@v2 - with: - repository: onflow/flow-go - ref: c0afa789365eb7a22713ed76b8de1e3efaf3a70a - path: flow-go - - - name: Install Go - uses: actions/setup-go@v2 - with: - go-version: 1.17 - - - name: Cache Go modules - uses: actions/cache@v2 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - # Here, we simply print the exact go version, to have it as part of the - # action's output, which might be convenient. - - name: Print Go version - run: go version - - # The protobuf steps uses the official instructions to install the - # pre-compiled binary, see: - # https://grpc.io/docs/protoc-installation/#install-pre-compiled-binaries-any-os - - name: Install Protobuf compiler - run: | - PB_REL="https://github.com/protocolbuffers/protobuf/releases" - curl -LO $PB_REL/download/v3.17.3/protoc-3.17.3-linux-x86_64.zip - unzip protoc-3.17.3-linux-x86_64.zip -d $HOME/.local - export PATH="$PATH:$HOME/.local/bin" - git clean -fd - - # In order to be able to generate the protocol buffer and GRPC files, we - # need to install the related Go modules. - - name: Install Protobuf dependencies - run: | - go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26 - go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1 - go install github.com/srikrsna/protoc-gen-gotag@v0.6.1 - - # In order to be able to build with flow-go and the relic tag, we need to - # run its go generate target. - - name: Install Flow Go's crypto - run: | - cd ./flow-go/crypto - go generate . - - # This check makes sure that the `go.mod` and `go.sum` files for Go - # modules are always up-to-date. - - name: Verify Go modules - run: go mod tidy && git status && git --no-pager diff && git diff-index --quiet HEAD -- - - # This check makes sure that the generated protocol buffer files in Go - # have been updated in case there was a change in the definitions. - - name: Generate files - run: go generate ./... && git status && git --no-pager diff && git diff-index --quiet HEAD -- - - # Install GoReleaser and print its version before running. - - name: Install GoReleaser - uses: goreleaser/goreleaser-action@v2 - with: - install-only: true - - - name: Show GoReleaser version - run: goreleaser -v - - # Run GoReleaser. - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v2 - with: - distribution: goreleaser - version: latest - args: release --rm-dist - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 83ff029..1e4b9bc 100755 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,13 @@ jobs: - name: Check out source code uses: actions/checkout@v2 + - name: Check out FlowGo + uses: actions/checkout@v2 + with: + repository: onflow/flow-go + ref: c0afa789365eb7a22713ed76b8de1e3efaf3a70a + path: flow-go + - name: Install Go uses: actions/setup-go@v2 with: @@ -34,6 +41,41 @@ jobs: - name: Print Go version run: go version + # The protobuf steps uses the official instructions to install the + # pre-compiled binary, see: + # https://grpc.io/docs/protoc-installation/#install-pre-compiled-binaries-any-os + - name: Install Protobuf compiler + run: | + PB_REL="https://github.com/protocolbuffers/protobuf/releases" + curl -LO $PB_REL/download/v3.17.3/protoc-3.17.3-linux-x86_64.zip + unzip protoc-3.17.3-linux-x86_64.zip -d $HOME/.local + export PATH="$PATH:$HOME/.local/bin" + git clean -fd + + # In order to be able to generate the protocol buffer and GRPC files, we + # need to install the related Go modules. + - name: Install Protobuf dependencies + run: | + go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26 + go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1 + go install github.com/srikrsna/protoc-gen-gotag@v0.6.1 + + # Since building relic takes some time, we want to cache it. + - name: Cache Crypto package + uses: actions/cache@v2 + with: + path: ./flow-go/crypto + key: ${{ runner.os }}-crypto + restore-keys: | + ${{ runner.os }}-crypto + + # In order to be able to build with flow-go and the relic tag, we need to + # run its go generate target. + - name: Install Flow Go's crypto + run: | + cd ./flow-go/crypto + go generate . + # This check makes sure that the `go.mod` and `go.sum` files for Go # modules are always up-to-date. - name: Verify Go modules diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 16351b0..05db0aa 100755 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,6 +16,13 @@ jobs: with: fetch-depth: 0 + - name: Check out FlowGo + uses: actions/checkout@v2 + with: + repository: onflow/flow-go + ref: c0afa789365eb7a22713ed76b8de1e3efaf3a70a + path: flow-go + - name: Install Go uses: actions/setup-go@v2 with: @@ -34,6 +41,32 @@ jobs: - name: Print Go version run: go version + # The protobuf steps uses the official instructions to install the + # pre-compiled binary, see: + # https://grpc.io/docs/protoc-installation/#install-pre-compiled-binaries-any-os + - name: Install Protobuf compiler + run: | + PB_REL="https://github.com/protocolbuffers/protobuf/releases" + curl -LO $PB_REL/download/v3.17.3/protoc-3.17.3-linux-x86_64.zip + unzip protoc-3.17.3-linux-x86_64.zip -d $HOME/.local + export PATH="$PATH:$HOME/.local/bin" + git clean -fd + + # In order to be able to generate the protocol buffer and GRPC files, we + # need to install the related Go modules. + - name: Install Protobuf dependencies + run: | + go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26 + go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1 + go install github.com/srikrsna/protoc-gen-gotag@v0.6.1 + + # In order to be able to build with flow-go and the relic tag, we need to + # run its go generate target. + - name: Install Flow Go's crypto + run: | + cd ./flow-go/crypto + go generate . + # This check makes sure that the `go.mod` and `go.sum` files for Go # modules are always up-to-date. - name: Verify Go modules diff --git a/.gitignore b/.gitignore index 81430d3..c56174b 100755 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ *.cdc *.checkpoint *.log +flow-go/ \ No newline at end of file diff --git a/cmd/flow-rosetta-server/README.md b/cmd/flow-rosetta-server/README.md new file mode 100755 index 0000000..23af62a --- /dev/null +++ b/cmd/flow-rosetta-server/README.md @@ -0,0 +1,51 @@ +# Flow Rosetta Server + +## Description + +The Flow Rosetta Server implements the Rosetta Data API specifications for the Flow network. +It uses the Flow DPS Server's GRPC API as the backend to query the required data. +Flow core contract addresses are derived from the chain ID with which the service is started. +This allows the Rosetta API to access state remotely, or locally by running the Flow DPS Server on the same host. + +## Testing + +The Flow system model, where resources can be moved freely between accounts without generating events, makes it impossible to fully reconcile account balances on the Rosetta Data API. +As a consequence, balance reconciliation has to be disabled when running the Rosetta CLI against the Flow Rosetta Server. + +Additionally, some of the events generated by Flow are not accurately reflecting the account address they relate to. +This is also due to the same resource-based smart contract programming model. +For instance, when an account receives vaults from different locations to execute a swap of tokens, the events related to this swap might indicate the swap +contract's address, as it uses volatile vaults. + +Currently, the only way to work around this issue is to create exemptions for accounts which contain such smart contracts. +As account balances using non-standard approaches to transfer Flow tokens can already not be reconciled, this is an acceptable limitation. +In general, transactions by Rosetta should not be used to deduce account balances. +Full historical account balance lookup is available and should thus be prefered to determine the account balance at any block height. + +The discussed configuration is available in the `flow.json` and `exemptions.json` files for the `mainnet-9` spork DPS. +The following command can be executed to validate the Data API for that spork: + +```sh +rosetta-cli check:data --configuration-file flow.json +``` + +## Usage + +```sh +Usage of flow-rosetta-server: + -a, --api string host URL for GRPC API endpoint (default "127.0.0.1:5005") + -e, --cache uint maximum cache size for register reads in bytes (default 1073741824) + -l, --level string log output level (default "info") + -p, --port uint16 port to host Rosetta API on (default 8080) + -t, --transaction-limit int maximum amount of transactions to include in a block response (default 200) + --smart-status-codes enable smart non-500 HTTP status codes for Rosetta API errors +``` + +## Example + +The following command line starts the Flow Rosetta server for a main network spork on port 8080. +It uses a local instance of the Flow DPS Server for access to the execution state. + +```sh +./flow-rosetta-server -a "127.0.0.1:5005" -p 8080 +``` diff --git a/cmd/flow-rosetta-server/exemptions.json b/cmd/flow-rosetta-server/exemptions.json new file mode 100755 index 0000000..b27b2e8 --- /dev/null +++ b/cmd/flow-rosetta-server/exemptions.json @@ -0,0 +1,20 @@ +[ + { + "account_identifier": { + "address": "8624b52f9ddcd04a" + }, + "currency": { + "symbol": "FLOW", + "decimals": 8 + } + }, + { + "account_identifier": { + "address": "c6c77b9f5c7a378f" + }, + "currency": { + "symbol": "FLOW", + "decimals": 8 + } + } +] diff --git a/cmd/flow-rosetta-server/flow.json b/cmd/flow-rosetta-server/flow.json new file mode 100755 index 0000000..5876f48 --- /dev/null +++ b/cmd/flow-rosetta-server/flow.json @@ -0,0 +1,41 @@ +{ + "network": { + "blockchain": "flow", + "network": "flow-mainnet" + }, + "online_url": "http://mainnet9.dps.optakt.io:8080", + "data_directory": "", + "http_timeout": 10, + "max_retries": 5, + "retry_elapsed_time": 0, + "max_online_connections": 120, + "max_sync_concurrency": 64, + "tip_delay": 300, + "max_reorg_depth": 4, + "log_configuration": false, + "compression_disabled": false, + "memory_limit_disabled": false, + "construction": null, + "data": { + "active_reconciliation_concurrency": 16, + "inactive_reconciliation_concurrency": 4, + "inactive_reconciliation_frequency": 250, + "log_blocks": false, + "log_transactions": false, + "log_balance_changes": false, + "log_reconciliations": false, + "ignore_reconciliation_error": false, + "exempt_accounts": "exemptions.json", + "bootstrap_balances": "", + "interesting_accounts": "", + "reconciliation_disabled": true, + "reconciliation_drain_disabled": false, + "inactive_discrepency_search_disabled": false, + "balance_tracking_disabled": false, + "coin_tracking_disabled": false, + "status_port": 9090, + "results_output_file": "", + "pruning_disabled": false, + "initial_balance_fetch_disabled": false + } +} diff --git a/cmd/flow-rosetta-server/main.go b/cmd/flow-rosetta-server/main.go new file mode 100755 index 0000000..8365e12 --- /dev/null +++ b/cmd/flow-rosetta-server/main.go @@ -0,0 +1,236 @@ +// Copyright 2021 Optakt Labs OÜ +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +package main + +import ( + "context" + "errors" + "fmt" + "net/http" + "os" + "os/signal" + "time" + + "github.com/labstack/echo/v4" + "github.com/rs/zerolog" + "github.com/spf13/pflag" + "github.com/ziflex/lecho/v2" + "google.golang.org/grpc" + + "github.com/onflow/flow-go-sdk/client" + + api "github.com/optakt/flow-dps/api/dps" + "github.com/optakt/flow-dps/codec/zbor" + "github.com/optakt/flow-dps/models/dps" + "github.com/optakt/flow-dps/service/invoker" + "github.com/optakt/flow-rosetta/api/rosetta" + "github.com/optakt/flow-rosetta/rosetta/configuration" + "github.com/optakt/flow-rosetta/rosetta/converter" + "github.com/optakt/flow-rosetta/rosetta/retriever" + "github.com/optakt/flow-rosetta/rosetta/scripts" + "github.com/optakt/flow-rosetta/rosetta/submitter" + "github.com/optakt/flow-rosetta/rosetta/transactor" + "github.com/optakt/flow-rosetta/rosetta/validator" +) + +const ( + success = 0 + failure = 1 +) + +func main() { + os.Exit(run()) +} + +func run() int { + + // Signal catching for clean shutdown. + sig := make(chan os.Signal, 1) + signal.Notify(sig, os.Interrupt) + + // Command line parameter initialization. + var ( + flagDPS string + flagAccess string + flagCache uint64 + flagLevel string + flagPort uint16 + flagTransactions uint + flagSmart bool + ) + + pflag.StringVarP(&flagDPS, "dps-api", "a", "127.0.0.1:5005", "host address for GRPC API endpoint") + pflag.StringVarP(&flagAccess, "access-api", "c", "access.canary.nodes.onflow.org:9000", "host address for Flow network's Access API endpoint") + pflag.Uint64VarP(&flagCache, "cache", "e", 1_000_000_000, "maximum cache size for register reads in bytes") + pflag.StringVarP(&flagLevel, "level", "l", "info", "log output level") + pflag.Uint16VarP(&flagPort, "port", "p", 8080, "port to host Rosetta API on") + pflag.UintVarP(&flagTransactions, "transaction-limit", "t", 200, "maximum amount of transactions to include in a block response") + pflag.BoolVar(&flagSmart, "smart-status-codes", false, "enable smart non-500 HTTP status codes for Rosetta API errors") + + pflag.Parse() + + // Logger initialization. + zerolog.TimestampFunc = func() time.Time { return time.Now().UTC() } + log := zerolog.New(os.Stderr).With().Timestamp().Logger().Level(zerolog.DebugLevel) + level, err := zerolog.ParseLevel(flagLevel) + if err != nil { + log.Error().Str("level", flagLevel).Err(err).Msg("could not parse log level") + return failure + } + log = log.Level(level) + elog := lecho.From(log) + + // Initialize codec. + codec := zbor.NewCodec() + + // Initialize the DPS API client and wrap it for easy usage. + conn, err := grpc.Dial(flagDPS, grpc.WithInsecure()) + if err != nil { + log.Error().Str("api", flagDPS).Err(err).Msg("could not dial API host") + return failure + } + defer conn.Close() + dpsAPI := api.NewAPIClient(conn) + index := api.IndexFromAPI(dpsAPI, codec) + + // Deduce chain ID from DPS API to configure parameters for script exec. + first, err := index.First() + if err != nil { + log.Error().Err(err).Msg("could not get first height from DPS API") + return failure + } + root, err := index.Header(first) + if err != nil { + log.Error().Uint64("first", first).Err(err).Msg("could not get root header from DPS API") + return failure + } + params, ok := dps.FlowParams[root.ChainID] + if !ok { + log.Error().Str("chain", root.ChainID.String()).Msg("invalid chain ID for params") + return failure + } + + // Initialize the SDK client. + if flagAccess == "" { + log.Error().Msg("Flow Access API endpoint is missing") + return failure + } + accessAPI, err := client.New(flagAccess, grpc.WithInsecure()) + if err != nil { + log.Error().Str("address", flagAccess).Err(err).Msg("could not dial Flow Access API address") + return failure + } + defer accessAPI.Close() + + // If smart status codes are enabled for the Rosetta API, we change the HTTP + // status code constants here. + if flagSmart { + rosetta.EnableSmartCodes() + } + + // Rosetta API initialization. + config := configuration.New(params.ChainID) + validate := validator.New(params, index, config) + generate := scripts.NewGenerator(params) + invoke, err := invoker.New(index, invoker.WithCacheSize(flagCache)) + if err != nil { + log.Error().Err(err).Msg("could not initialize invoker") + return failure + } + + convert, err := converter.New(generate) + if err != nil { + log.Error().Err(err).Msg("could not generate transaction event types") + return failure + } + + retrieve := retriever.New(params, index, validate, generate, invoke, convert, + retriever.WithTransactionLimit(flagTransactions), + ) + dataCtrl := rosetta.NewData(config, retrieve, validate) + + submit := submitter.New(accessAPI) + transact := transactor.New(validate, generate, invoke, submit) + constructCtrl := rosetta.NewConstruction(config, transact, retrieve, validate) + + server := echo.New() + server.HideBanner = true + server.HidePort = true + server.Logger = elog + server.Use(lecho.Middleware(lecho.Config{Logger: elog})) + + // This group contains all of the Rosetta Data API endpoints. + server.POST("/network/list", dataCtrl.Networks) + server.POST("/network/options", dataCtrl.Options) + server.POST("/network/status", dataCtrl.Status) + server.POST("/account/balance", dataCtrl.Balance) + server.POST("/block", dataCtrl.Block) + server.POST("/block/transaction", dataCtrl.Transaction) + + // This group contains all of the Rosetta Construction API endpoints. + server.POST("/construction/preprocess", constructCtrl.Preprocess) + server.POST("/construction/metadata", constructCtrl.Metadata) + server.POST("/construction/payloads", constructCtrl.Payloads) + server.POST("/construction/parse", constructCtrl.Parse) + server.POST("/construction/combine", constructCtrl.Combine) + server.POST("/construction/hash", constructCtrl.Hash) + server.POST("/construction/submit", constructCtrl.Submit) + + // This section launches the main executing components in their own + // goroutine, so they can run concurrently. Afterwards, we wait for an + // interrupt signal in order to proceed with the next section. + done := make(chan struct{}) + failed := make(chan struct{}) + go func() { + log.Info().Msg("Flow Rosetta Server starting") + err := server.Start(fmt.Sprint(":", flagPort)) + if err != nil && !errors.Is(err, http.ErrServerClosed) { + log.Warn().Err(err).Msg("Flow Rosetta Server failed") + close(failed) + } else { + close(done) + } + log.Info().Msg("Flow Rosetta Server stopped") + }() + + select { + case <-sig: + log.Info().Msg("Flow Rosetta Server stopping") + case <-done: + log.Info().Msg("Flow Rosetta Server done") + case <-failed: + log.Warn().Msg("Flow Rosetta Server aborted") + return failure + } + go func() { + <-sig + log.Warn().Msg("forcing exit") + os.Exit(1) + }() + + // The following code starts a shut down with a certain timeout and makes + // sure that the main executing components are shutting down within the + // allocated shutdown time. Otherwise, we will force the shutdown and log + // an error. We then wait for shutdown on each component to complete. + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + err = server.Shutdown(ctx) + if err != nil { + log.Error().Err(err).Msg("could not shut down Rosetta API") + return failure + } + + return success +} diff --git a/go.mod b/go.mod index 6cfd064..cc63027 100755 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/onflow/cadence v0.19.1 github.com/onflow/flow-go v0.21.2 github.com/onflow/flow-go-sdk v0.21.0 - github.com/onflow/flow-go/crypto v0.18.0 + github.com/onflow/flow-go/crypto v0.21.2 github.com/optakt/flow-dps v1.3.3 github.com/rs/zerolog v1.25.0 github.com/spf13/pflag v1.0.5 @@ -21,8 +21,8 @@ require ( ) require ( - cloud.google.com/go v0.84.0 // indirect - cloud.google.com/go/storage v1.16.0 // indirect + cloud.google.com/go v0.93.3 // indirect + cloud.google.com/go/storage v1.16.1 // indirect github.com/OneOfOne/xxhash v1.2.8 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/btcsuite/btcd v0.21.0-beta // indirect @@ -30,7 +30,7 @@ require ( github.com/cespare/xxhash/v2 v2.1.1 // indirect github.com/cheekybits/genny v1.0.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de // indirect + github.com/dgraph-io/ristretto v0.1.0 // indirect github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 // indirect github.com/dustin/go-humanize v1.0.0 // indirect github.com/ef-ds/deque v1.0.4 // indirect @@ -45,10 +45,12 @@ require ( github.com/go-test/deep v1.0.5 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-jwt/jwt v3.2.2+incompatible // indirect + github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/golang/snappy v0.0.3 // indirect - github.com/googleapis/gax-go/v2 v2.0.5 // indirect + github.com/google/go-cmp v0.5.6 // indirect + github.com/googleapis/gax-go/v2 v2.1.0 // indirect github.com/hashicorp/errwrap v1.0.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/golang-lru v0.5.4 // indirect @@ -56,7 +58,6 @@ require ( github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/ipfs/go-cid v0.0.7 // indirect github.com/jrick/bitset v1.0.0 // indirect - github.com/jstemmer/go-junit-report v0.9.1 // indirect github.com/kevinburke/go-bindata v3.22.0+incompatible // indirect github.com/klauspost/cpuid/v2 v2.0.4 // indirect github.com/labstack/gommon v0.3.0 // indirect @@ -96,7 +97,7 @@ require ( github.com/rivo/uniseg v0.2.0 // indirect github.com/sethvargo/go-retry v0.1.0 // indirect github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 // indirect - github.com/spf13/afero v1.1.2 // indirect + github.com/spf13/afero v1.5.1 // indirect github.com/spf13/cast v1.3.0 // indirect github.com/spf13/cobra v1.1.3 // indirect github.com/spf13/jwalterweatherman v1.0.0 // indirect @@ -115,20 +116,20 @@ require ( go.opencensus.io v0.23.0 // indirect go.uber.org/atomic v1.7.0 // indirect golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 // indirect - golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420 // indirect - golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 // indirect + golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f // indirect golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect - golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069 // indirect + golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf // indirect golang.org/x/text v0.3.6 // indirect golang.org/x/time v0.0.0-20201208040808-7e3f01d25324 // indirect - golang.org/x/tools v0.1.5 // indirect golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect - google.golang.org/api v0.49.0 // indirect + google.golang.org/api v0.56.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a // indirect + google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71 // indirect google.golang.org/protobuf v1.27.1 // indirect gopkg.in/ini.v1 v1.51.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) + +replace github.com/onflow/flow-go/crypto => ./flow-go/crypto diff --git a/go.sum b/go.sum index 8004a68..3e5d246 100644 --- a/go.sum +++ b/go.sum @@ -21,10 +21,10 @@ cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECH cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= -cloud.google.com/go v0.84.0 h1:hVhK90DwCdOAYGME/FJd9vNIZye9HBR6Yy3fu4js3N8= cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= +cloud.google.com/go v0.93.3 h1:wPBktZFzYBcCZVARvwVKqH1uEj+aLXofJEtrb4oOsio= cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= @@ -44,8 +44,8 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.16.0 h1:1UwAux2OZP4310YXg5ohqBEpV16Y93uZG4+qOX7K2Kg= cloud.google.com/go/storage v1.16.0/go.mod h1:ieKBmUyzcftN5tbxwnXClMKH00CfcQ+xL6NN0r5QfmE= +cloud.google.com/go/storage v1.16.1 h1:sMEIc4wxvoY3NXG7Rn9iP7jb/2buJgWR1vNXCR/UPfs= cloud.google.com/go/storage v1.16.1/go.mod h1:LaNorbty3ehnU3rEjXSNV/NRgQA0O8Y+uh6bPe5UOk4= dmitri.shuralyov.com/app/changes v0.0.0-20180602232624-0a106ad413e3/go.mod h1:Yl+fi1br7+Rr3LqpNJf1/uxUdtRUV+Tnj0o93V2B9MU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -203,8 +203,8 @@ github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdw github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= github.com/dgraph-io/ristretto v0.0.2-0.20200115201040-8f368f2f2ab3/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgraph-io/ristretto v0.0.2/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= -github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de h1:t0UHb5vdojIDUqktM6+xJAfScFBsVpXZmqC9dsgJmeA= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= +github.com/dgraph-io/ristretto v0.1.0 h1:Jv3CGQHp9OjuMBSne1485aDpUkTKEcUqF+jm/LuerPI= github.com/dgraph-io/ristretto v0.1.0/go.mod h1:fux0lOrBhrVCJd3lcTHsIJhq1T2rokOu6v9Vcb3Q9ug= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-farm v0.0.0-20190104051053-3adb47b1fb0f/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= @@ -303,6 +303,7 @@ github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69 github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -398,8 +399,8 @@ github.com/googleapis/gax-go v2.0.0+incompatible h1:j0GKcs05QVmm7yesiZq2+9cxHkNK github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/gax-go/v2 v2.1.0 h1:6DWmvNpomjL1+3liNSZbVns3zsYzzCjm6pRBO1tLeso= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -545,7 +546,6 @@ github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= @@ -1006,9 +1006,6 @@ github.com/onflow/flow-go-sdk v0.20.0-alpha.1/go.mod h1:52QZyLwU3p3UZ2FXOy+sRl4J github.com/onflow/flow-go-sdk v0.20.0/go.mod h1:52QZyLwU3p3UZ2FXOy+sRl4JPdtvJoae1spIUBOFxA8= github.com/onflow/flow-go-sdk v0.21.0 h1:KRU6F80KZLD+CJLj57S2EaAPNJUx4qpFTw1Ok0AJZ1M= github.com/onflow/flow-go-sdk v0.21.0/go.mod h1:2xhtzwRAeItwbHQzHiIK2gPgLDw1hNPa0xYlpvx8Gx4= -github.com/onflow/flow-go/crypto v0.12.0/go.mod h1:oXuvU0Dr4lHKgye6nHEFbBXIWNv+dBQUzoVW5Go38+o= -github.com/onflow/flow-go/crypto v0.18.0 h1:2tucSdxmld/08LfIfLxGfw+8QuSNFiHAUojX5AFvq6k= -github.com/onflow/flow-go/crypto v0.18.0/go.mod h1:3Ah843iPyjIL+7nH9EillV3OWNptrL+DrQUbVKgg2E4= github.com/onflow/flow/protobuf/go/flow v0.1.9/go.mod h1:kRugbzZjwQqvevJhrnnCFMJZNmoSJmxlKt6hTGXZojM= github.com/onflow/flow/protobuf/go/flow v0.2.0/go.mod h1:kRugbzZjwQqvevJhrnnCFMJZNmoSJmxlKt6hTGXZojM= github.com/onflow/flow/protobuf/go/flow v0.2.2 h1:EVhA0w3lu+BG7RK39ojIJVghLH998iP7YC0V/Op0KnU= @@ -1182,9 +1179,9 @@ github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasO github.com/spaolacci/murmur3 v1.0.1-0.20190317074736-539464a789e9/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= +github.com/spf13/afero v1.5.1 h1:VHu76Lk0LSP1x254maIu2bplkWpfBWI+B+6fdoZprcg= github.com/spf13/afero v1.5.1/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= @@ -1225,6 +1222,8 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/supranational/blst v0.3.4 h1:iZE9lBMoywK2uy2U/5hDOvobQk9FnOQ2wNlu9GmRCoA= +github.com/supranational/blst v0.3.4/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ= github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d/go.mod h1:9OrXJhf154huy1nPWmuSrkgjPUtUNhA+Zmy+6AESzuA= github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= @@ -1463,10 +1462,10 @@ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 h1:x622Z2o4hgCr/4CiKWc51jHVKaWdtVpBNmEI8wI9Qns= golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f h1:Qmd2pbz05z7z6lm0DrgQVVPuBm92jqujBKMHMOlOQEw= golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1573,8 +1572,8 @@ golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069 h1:siQdpVirKtzPhKl3lZWozZraCFObP8S1v6PRp0bLrtU= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf h1:2ucpDCmfkl8Bd/FsLtiD653Wf96cW37s+iGx93zsu4k= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -1704,11 +1703,11 @@ google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBz google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= -google.golang.org/api v0.49.0 h1:gjIBDxlTG7vnzMmEnYwTnvLTF8Rjzo+ETCgEX1YZ/fY= google.golang.org/api v0.49.0/go.mod h1:BECiH72wsfwUvOVn3+btPD5WHi0LzavZReBndi42L18= google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= +google.golang.org/api v0.56.0 h1:08F9XVYTLOGeSQb3xI9C0gXMuQanhdGed0cWFhDozbI= google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1771,7 +1770,6 @@ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxH google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a h1:b5Bhxmy6Tppar7Yl4J6c6xF33YSBhkm2FtV9/ZQuBkQ= google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= @@ -1781,6 +1779,7 @@ google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKr google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210825212027-de86158e7fda/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71 h1:z+ErRPu0+KS02Td3fOAgdX+lnPDh/VyaABEJPD4JRQs= google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= @@ -1879,6 +1878,7 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +pgregory.net/rapid v0.4.7 h1:MTNRktPuv5FNqOO151TM9mDTa+XHcX6ypYeISDVD14g= pgregory.net/rapid v0.4.7/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/models/convert/convert/cadence.go b/models/convert/cadence.go similarity index 100% rename from models/convert/convert/cadence.go rename to models/convert/cadence.go diff --git a/models/convert/convert/cadence_test.go b/models/convert/cadence_test.go similarity index 100% rename from models/convert/convert/cadence_test.go rename to models/convert/cadence_test.go diff --git a/models/convert/convert/hash.go b/models/convert/hash.go similarity index 100% rename from models/convert/convert/hash.go rename to models/convert/hash.go diff --git a/models/convert/convert/hash_test.go b/models/convert/hash_test.go similarity index 100% rename from models/convert/convert/hash_test.go rename to models/convert/hash_test.go diff --git a/models/convert/convert/paths.go b/models/convert/paths.go similarity index 100% rename from models/convert/convert/paths.go rename to models/convert/paths.go diff --git a/models/convert/convert/paths_test.go b/models/convert/paths_test.go similarity index 100% rename from models/convert/convert/paths_test.go rename to models/convert/paths_test.go diff --git a/models/convert/convert/types.go b/models/convert/types.go similarity index 100% rename from models/convert/convert/types.go rename to models/convert/types.go diff --git a/models/convert/convert/types_test.go b/models/convert/types_test.go similarity index 100% rename from models/convert/convert/types_test.go rename to models/convert/types_test.go diff --git a/models/convert/convert/values.go b/models/convert/values.go similarity index 100% rename from models/convert/convert/values.go rename to models/convert/values.go diff --git a/models/convert/convert/values_test.go b/models/convert/values_test.go similarity index 100% rename from models/convert/convert/values_test.go rename to models/convert/values_test.go