Skip to content
Open
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
17 changes: 9 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}
Expand All @@ -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 \
Expand All @@ -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:
Expand All @@ -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 }}
Expand Down Expand Up @@ -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 }}
Expand Down
8 changes: 4 additions & 4 deletions cmd/util/cmd/verify_execution_result/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down Expand Up @@ -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")
}
Expand Down Expand Up @@ -106,7 +106,7 @@ func run(*cobra.Command, []string) {
flagChunkDataPackDir,
flagWorkerCount,
flagStopOnMismatch,
flagtransactionFeesDisabled,
flagTransactionFeesDisabled,
flagScheduledTransactionsEnabled,
)
if err != nil {
Expand All @@ -124,7 +124,7 @@ func run(*cobra.Command, []string) {
flagChunkDataPackDir,
flagWorkerCount,
flagStopOnMismatch,
flagtransactionFeesDisabled,
flagTransactionFeesDisabled,
flagScheduledTransactionsEnabled,
)
if err != nil {
Expand Down
12 changes: 10 additions & 2 deletions engine/verification/verifier/verifiers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion fvm/accounts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion fvm/blueprints/contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
8 changes: 4 additions & 4 deletions fvm/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
Expand Down
18 changes: 9 additions & 9 deletions fvm/environment/system_contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
},
Expand Down Expand Up @@ -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),
},
Expand Down Expand Up @@ -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),
},
)
}
Expand All @@ -227,7 +227,7 @@ func (sys *SystemContracts) AccountAvailableBalance(
return sys.Invoke(
accountAvailableBalanceSpec,
[]cadence.Value{
cadence.BytesToAddress(address.Bytes()),
cadence.Address(address),
},
)
}
Expand All @@ -253,7 +253,7 @@ func (sys *SystemContracts) AccountBalance(
return sys.Invoke(
accountBalanceInvocationSpec,
[]cadence.Value{
cadence.BytesToAddress(address.Bytes()),
cadence.Address(address),
},
)
}
Expand All @@ -275,7 +275,7 @@ func (sys *SystemContracts) AccountStorageCapacity(
return sys.Invoke(
accountStorageCapacitySpec,
[]cadence.Value{
cadence.BytesToAddress(address.Bytes()),
cadence.Address(address),
},
)
}
Expand All @@ -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(
Expand All @@ -308,7 +308,7 @@ func (sys *SystemContracts) AccountsStorageCapacity(
},
[]cadence.Value{
cadence.NewArray(arrayValues),
cadence.BytesToAddress(payer.Bytes()),
cadence.Address(payer),
cadence.UFix64(maxTxFees),
},
)
Expand Down
6 changes: 4 additions & 2 deletions fvm/environment/system_contracts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,17 @@ func TestSystemContractsInvoke(t *testing.T) {
environment.NewProgramLogger(
tracer,
environment.DefaultProgramLoggerParams()),
runtime)
runtime,
)
value, err := invoker.Invoke(
environment.ContractFunctionSpec{
AddressFromChain: func(_ flow.Chain) flow.Address {
return flow.EmptyAddress
},
FunctionName: "functionName",
},
[]cadence.Value{})
nil,
)

tc.require(t, value, err)
})
Expand Down
2 changes: 1 addition & 1 deletion integration/benchmark/scripts/scripts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
Loading