diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 174dbbab3a4..1555f3f954f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -121,7 +121,7 @@ jobs: uses: actions/checkout@v6 - name: Setup private build environment - if: ${{ vars.PRIVATE_BUILDS_SUPPORTED == 'true' }} + if: ${{ vars.PRIVATE_BUILDS_SUPPORTED == 'true' }} uses: ./actions/private-setup with: cadence_deploy_key: ${{ secrets.CADENCE_DEPLOY_KEY }} @@ -205,7 +205,7 @@ jobs: uses: actions/checkout@v6 - name: Setup private build environment - if: ${{ vars.PRIVATE_BUILDS_SUPPORTED == 'true' }} + if: ${{ vars.PRIVATE_BUILDS_SUPPORTED == 'true' }} uses: ./actions/private-setup with: cadence_deploy_key: ${{ secrets.CADENCE_DEPLOY_KEY }} @@ -251,7 +251,7 @@ jobs: uses: actions/checkout@v6 - name: Setup private build environment - if: ${{ vars.PRIVATE_BUILDS_SUPPORTED == 'true' }} + if: ${{ vars.PRIVATE_BUILDS_SUPPORTED == 'true' }} uses: ./actions/private-setup with: cadence_deploy_key: ${{ secrets.CADENCE_DEPLOY_KEY }} @@ -296,7 +296,7 @@ jobs: fetch-depth: 0 - name: Setup private build environment - if: ${{ vars.PRIVATE_BUILDS_SUPPORTED == 'true' }} + if: ${{ vars.PRIVATE_BUILDS_SUPPORTED == 'true' }} uses: ./actions/private-setup with: cadence_deploy_key: ${{ secrets.CADENCE_DEPLOY_KEY }} @@ -317,11 +317,11 @@ jobs: # this docker auth is exclusively for higher rate limits. continue unauthenticated if it fails continue-on-error: true - - name: Docker build env: CADENCE_DEPLOY_KEY: ${{ secrets.CADENCE_DEPLOY_KEY }} run: make docker-native-build-flow docker-native-build-flow-corrupt + - name: Save Docker images run: | docker save \ @@ -336,6 +336,7 @@ jobs: gcr.io/flow-container-registry/access-corrupted:latest \ gcr.io/flow-container-registry/execution-corrupted:latest \ gcr.io/flow-container-registry/verification-corrupted:latest > flow-docker-images.tar + - name: Cache Docker images uses: actions/cache@v5 with: @@ -356,9 +357,9 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@v6 - + - name: Setup private build environment - if: ${{ vars.PRIVATE_BUILDS_SUPPORTED == 'true' }} + if: ${{ vars.PRIVATE_BUILDS_SUPPORTED == 'true' }} uses: ./actions/private-setup with: cadence_deploy_key: ${{ secrets.CADENCE_DEPLOY_KEY }} @@ -458,7 +459,7 @@ jobs: fetch-depth: 0 - name: Setup private build environment - if: ${{ vars.PRIVATE_BUILDS_SUPPORTED == 'true' }} + if: ${{ vars.PRIVATE_BUILDS_SUPPORTED == 'true' }} uses: ./actions/private-setup with: cadence_deploy_key: ${{ secrets.CADENCE_DEPLOY_KEY }} diff --git a/cmd/util/cmd/verify_execution_result/cmd.go b/cmd/util/cmd/verify_execution_result/cmd.go index 546be9c071a..42e9eabbf76 100644 --- a/cmd/util/cmd/verify_execution_result/cmd.go +++ b/cmd/util/cmd/verify_execution_result/cmd.go @@ -23,7 +23,7 @@ var ( flagFromTo string flagWorkerCount uint // number of workers to verify the blocks concurrently flagStopOnMismatch bool - flagtransactionFeesDisabled bool + flagTransactionFeesDisabled bool flagScheduledTransactionsEnabled bool ) @@ -58,7 +58,7 @@ func init() { Cmd.Flags().BoolVar(&flagStopOnMismatch, "stop_on_mismatch", false, "stop verification on first mismatch") - Cmd.Flags().BoolVar(&flagtransactionFeesDisabled, "fees_disabled", false, "disable transaction fees") + Cmd.Flags().BoolVar(&flagTransactionFeesDisabled, "fees_disabled", false, "disable transaction fees") Cmd.Flags().BoolVar(&flagScheduledTransactionsEnabled, "scheduled_callbacks_enabled", fvm.DefaultScheduledTransactionsEnabled, "[deprecated] enable scheduled transactions") } @@ -106,7 +106,7 @@ func run(*cobra.Command, []string) { flagChunkDataPackDir, flagWorkerCount, flagStopOnMismatch, - flagtransactionFeesDisabled, + flagTransactionFeesDisabled, flagScheduledTransactionsEnabled, ) if err != nil { @@ -124,7 +124,7 @@ func run(*cobra.Command, []string) { flagChunkDataPackDir, flagWorkerCount, flagStopOnMismatch, - flagtransactionFeesDisabled, + flagTransactionFeesDisabled, flagScheduledTransactionsEnabled, ) if err != nil { diff --git a/engine/verification/verifier/verifiers.go b/engine/verification/verifier/verifiers.go index d416d15a94e..90ad44bc96e 100644 --- a/engine/verification/verifier/verifiers.go +++ b/engine/verification/verifier/verifiers.go @@ -110,7 +110,8 @@ func VerifyRange( lockManager lockctx.Manager, from, to uint64, chainID flow.ChainID, - protocolDataDir string, chunkDataPackDir string, + protocolDataDir string, + chunkDataPackDir string, nWorker uint, stopOnMismatch bool, transactionFeesDisabled bool, @@ -323,7 +324,14 @@ func initStorages( chunkDataPacks := store.NewChunkDataPacks(metrics.NewNoopCollector(), db, storedChunkDataPacks, storages.Collections, 1000) - verifier := makeVerifier(log.Logger, chainID, storages.Headers, transactionFeesDisabled, scheduledTransactionsEnabled) + verifier := makeVerifier( + log.Logger, + chainID, + storages.Headers, + transactionFeesDisabled, + scheduledTransactionsEnabled, + ) + closer := func() error { var dbErr, chunkDataPackDBErr error diff --git a/fvm/accounts_test.go b/fvm/accounts_test.go index 80368ecda66..35ada309c6f 100644 --- a/fvm/accounts_test.go +++ b/fvm/accounts_test.go @@ -1413,7 +1413,8 @@ func TestGetAccountKey(t *testing.T) { ) t.Run("Multiple keys", - newVMTest().withContextOptions(options...). + newVMTest(). + withContextOptions(options...). run(func(t *testing.T, vm fvm.VM, chain flow.Chain, ctx fvm.Context, snapshotTree snapshot.SnapshotTree) { snapshotTree, address := createAccount( t, diff --git a/fvm/blueprints/contracts.go b/fvm/blueprints/contracts.go index 077182611dc..b2b2ade0022 100644 --- a/fvm/blueprints/contracts.go +++ b/fvm/blueprints/contracts.go @@ -51,7 +51,7 @@ func setContractAuthorizersTransaction( for _, address := range authorized { addressValues = append( addressValues, - cadence.BytesToAddress(address.Bytes())) + cadence.Address(address)) } addressesArg, err := jsoncdc.Encode(cadence.NewArray(addressValues)) diff --git a/fvm/context.go b/fvm/context.go index f7589ff6a20..08845a85d6e 100644 --- a/fvm/context.go +++ b/fvm/context.go @@ -239,7 +239,7 @@ func WithServiceAccount(enabled bool) Option { } } -// WithRestrictContractRemoval enables or disables restricted contract removal for a +// WithContractRemovalRestricted enables or disables restricted contract removal for a // virtual machine context. Warning! this would be overridden with the flag stored on chain. // this is just a fallback value func WithContractRemovalRestricted(enabled bool) Option { @@ -249,7 +249,7 @@ func WithContractRemovalRestricted(enabled bool) Option { } } -// WithRestrictedContractDeployment enables or disables restricted contract deployment for a +// WithContractDeploymentRestricted enables or disables restricted contract deployment for a // virtual machine context. Warning! this would be overridden with the flag stored on chain. // this is just a fallback value func WithContractDeploymentRestricted(enabled bool) Option { @@ -277,7 +277,7 @@ func WithAccountStorageLimit(enabled bool) Option { } } -// WithAuthorizationCheckxEnabled enables or disables pre-execution +// WithAuthorizationChecksEnabled enables or disables pre-execution // authorization checks. func WithAuthorizationChecksEnabled(enabled bool) Option { return func(ctx Context) Context { @@ -335,7 +335,7 @@ func WithRandomSourceHistoryCallAllowed(allowed bool) Option { } } -// WithReusableCadenceRuntimePool set the (shared) RedusableCadenceRuntimePool +// WithReusableCadenceRuntimePool set the (shared) ReusableCadenceRuntimePool // use for creating the cadence runtime. func WithReusableCadenceRuntimePool( pool reusableRuntime.ReusableCadenceRuntimePool, diff --git a/fvm/environment/system_contracts.go b/fvm/environment/system_contracts.go index 1beecdec043..7693bb6dc51 100644 --- a/fvm/environment/system_contracts.go +++ b/fvm/environment/system_contracts.go @@ -120,7 +120,7 @@ func (sys *SystemContracts) CheckPayerBalanceAndGetMaxTxFees( return sys.Invoke( verifyPayersBalanceForTransactionExecutionSpec, []cadence.Value{ - cadence.BytesToAddress(payer.Bytes()), + cadence.Address(payer), cadence.UFix64(inclusionEffort), cadence.UFix64(maxExecutionEffort), }, @@ -157,7 +157,7 @@ func (sys *SystemContracts) DeductTransactionFees( return sys.Invoke( deductTransactionFeeSpec, []cadence.Value{ - cadence.BytesToAddress(payer.Bytes()), + cadence.Address(payer), cadence.UFix64(inclusionEffort), cadence.UFix64(executionEffort), }, @@ -204,8 +204,8 @@ func (sys *SystemContracts) SetupNewAccount( return sys.Invoke( setupNewAccountSpec, []cadence.Value{ - cadence.BytesToAddress(flowAddress.Bytes()), - cadence.BytesToAddress(payer.Bytes()), + cadence.Address(flowAddress), + cadence.Address(payer), }, ) } @@ -227,7 +227,7 @@ func (sys *SystemContracts) AccountAvailableBalance( return sys.Invoke( accountAvailableBalanceSpec, []cadence.Value{ - cadence.BytesToAddress(address.Bytes()), + cadence.Address(address), }, ) } @@ -253,7 +253,7 @@ func (sys *SystemContracts) AccountBalance( return sys.Invoke( accountBalanceInvocationSpec, []cadence.Value{ - cadence.BytesToAddress(address.Bytes()), + cadence.Address(address), }, ) } @@ -275,7 +275,7 @@ func (sys *SystemContracts) AccountStorageCapacity( return sys.Invoke( accountStorageCapacitySpec, []cadence.Value{ - cadence.BytesToAddress(address.Bytes()), + cadence.Address(address), }, ) } @@ -288,7 +288,7 @@ func (sys *SystemContracts) AccountsStorageCapacity( ) (cadence.Value, error) { arrayValues := make([]cadence.Value, len(addresses)) for i, address := range addresses { - arrayValues[i] = cadence.BytesToAddress(address.Bytes()) + arrayValues[i] = cadence.Address(address) } return sys.Invoke( @@ -308,7 +308,7 @@ func (sys *SystemContracts) AccountsStorageCapacity( }, []cadence.Value{ cadence.NewArray(arrayValues), - cadence.BytesToAddress(payer.Bytes()), + cadence.Address(payer), cadence.UFix64(maxTxFees), }, ) diff --git a/fvm/environment/system_contracts_test.go b/fvm/environment/system_contracts_test.go index 923c19f2825..1162a5f71e3 100644 --- a/fvm/environment/system_contracts_test.go +++ b/fvm/environment/system_contracts_test.go @@ -79,7 +79,8 @@ func TestSystemContractsInvoke(t *testing.T) { environment.NewProgramLogger( tracer, environment.DefaultProgramLoggerParams()), - runtime) + runtime, + ) value, err := invoker.Invoke( environment.ContractFunctionSpec{ AddressFromChain: func(_ flow.Chain) flow.Address { @@ -87,7 +88,8 @@ func TestSystemContractsInvoke(t *testing.T) { }, FunctionName: "functionName", }, - []cadence.Value{}) + nil, + ) tc.require(t, value, err) }) diff --git a/integration/benchmark/scripts/scripts.go b/integration/benchmark/scripts/scripts.go index 54ccf32bebe..eecf4b3efc8 100644 --- a/integration/benchmark/scripts/scripts.go +++ b/integration/benchmark/scripts/scripts.go @@ -65,7 +65,7 @@ func TokenTransferTransaction(ftAddr, flowToken, toAddr flow.Address, amount cad if err != nil { return nil, err } - err = tx.AddArgument(cadence.BytesToAddress(toAddr.Bytes())) + err = tx.AddArgument(cadence.Address(toAddr)) if err != nil { return nil, err } diff --git a/integration/tests/access/cohort3/extended_indexing_test.go b/integration/tests/access/cohort3/extended_indexing_test.go index c84415ae372..6f514c817e3 100644 --- a/integration/tests/access/cohort3/extended_indexing_test.go +++ b/integration/tests/access/cohort3/extended_indexing_test.go @@ -488,7 +488,7 @@ func buildFlowTransferTx(t *testing.T, to sdk.Address, amount string) *sdk.Trans amountArg, err := cadence.NewUFix64(amount) require.NoError(t, err) - toArg := cadence.NewAddress(cadence.BytesToAddress(to.Bytes())) + toArg := cadence.NewAddress(to) tx := sdk.NewTransaction(). SetScript([]byte(strings.TrimSpace(script))). diff --git a/integration/tests/access/cohort3/extended_indexing_transfers_test.go b/integration/tests/access/cohort3/extended_indexing_transfers_test.go index 1b90b1f6697..c7c1026822b 100644 --- a/integration/tests/access/cohort3/extended_indexing_transfers_test.go +++ b/integration/tests/access/cohort3/extended_indexing_transfers_test.go @@ -327,7 +327,7 @@ func (s *ExtendedIndexingSuite) sendExampleTokenTransferTx( amountArg, err := cadence.NewUFix64(amount) s.Require().NoError(err) - toArg := cadence.NewAddress(cadence.BytesToAddress(to.Bytes())) + toArg := cadence.NewAddress(to) result := s.sendTransaction(ctx, client, script, amountArg, toArg) s.T().Logf("ExampleToken transfer sealed at height %d", result.BlockHeight) @@ -347,7 +347,7 @@ func (s *ExtendedIndexingSuite) sendMintNFTTx( contracts.MetadataViews.Address.Hex(), ) - toArg := cadence.NewAddress(cadence.BytesToAddress(to.Bytes())) + toArg := cadence.NewAddress(to) result := s.sendTransaction(ctx, client, script, toArg) s.T().Logf("ExampleNFT mint sealed at height %d", result.BlockHeight) return result