Skip to content

Commit 7158034

Browse files
authored
Merge pull request #7938 from onflow/josh/add-tx-manager
Updates core-contracts deps and adds deployment for FlowTransactionSchedulerUtils
2 parents 7399285 + 7c04939 commit 7158034

File tree

10 files changed

+42
-29
lines changed

10 files changed

+42
-29
lines changed

engine/execution/state/bootstrap/bootstrap_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func TestBootstrapLedger(t *testing.T) {
5757
}
5858

5959
func TestBootstrapLedger_ZeroTokenSupply(t *testing.T) {
60-
expectedStateCommitmentBytes, _ := hex.DecodeString("bc3daf8c462869759ffb7ced651d6c6a552a9df7c1268b3b8e6a9804260ab1c6")
60+
expectedStateCommitmentBytes, _ := hex.DecodeString("882b0d6e4b69733234018d359c6b97d252ab1a0a521e1097ed65d69bd1357251")
6161
expectedStateCommitment, err := flow.ToStateCommitment(expectedStateCommitmentBytes)
6262
require.NoError(t, err)
6363

@@ -104,7 +104,7 @@ func TestBootstrapLedger_ZeroTokenSupply(t *testing.T) {
104104
// - transaction fee deduction
105105
// This tests that the state commitment has not changed for the bookkeeping parts of the transaction.
106106
func TestBootstrapLedger_EmptyTransaction(t *testing.T) {
107-
expectedStateCommitmentBytes, _ := hex.DecodeString("85721a09e89b6b3bb5d064fa11da035b9dca4edb6f881c1e9a263da4176b7df8")
107+
expectedStateCommitmentBytes, _ := hex.DecodeString("677a70ac17338286e65c6e2bef0a5eff8495ba10226e44d662386ccf358d3140")
108108
expectedStateCommitment, err := flow.ToStateCommitment(expectedStateCommitmentBytes)
109109
require.NoError(t, err)
110110

fvm/bootstrap.go

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,8 +459,8 @@ func (b *bootstrapExecutor) Execute() error {
459459
// deploy staking collection contract to the service account
460460
b.deployStakingCollection(service, &env)
461461

462-
// deploy flow callback scheduler contract to the service account
463-
b.deployFlowCallbackScheduler(service, &env)
462+
// deploy flow transaction scheduler contract to the service account
463+
b.deployFlowTransactionScheduler(service, &env)
464464

465465
// sets up the EVM environment
466466
b.setupEVM(service, nonFungibleToken, fungibleToken, flowToken, &env)
@@ -798,7 +798,7 @@ func (b *bootstrapExecutor) deployNFTStorefrontV2(deployTo flow.Address, env *te
798798
panicOnMetaInvokeErrf("failed to deploy NFTStorefrontV2 contract: %s", txError, err)
799799
}
800800

801-
func (b *bootstrapExecutor) deployFlowCallbackScheduler(deployTo flow.Address, env *templates.Environment) {
801+
func (b *bootstrapExecutor) deployFlowTransactionScheduler(deployTo flow.Address, env *templates.Environment) {
802802
contract := contracts.FlowTransactionScheduler(*env)
803803
txBody, err := blueprints.DeployContractTransaction(deployTo, contract, "FlowTransactionScheduler").Build()
804804
if err != nil {
@@ -811,6 +811,19 @@ func (b *bootstrapExecutor) deployFlowCallbackScheduler(deployTo flow.Address, e
811811

812812
env.FlowTransactionSchedulerAddress = deployTo.String()
813813
panicOnMetaInvokeErrf("failed to deploy FlowTransactionScheduler contract: %s", txError, err)
814+
815+
contract = contracts.FlowTransactionSchedulerUtils(*env)
816+
txBody, err = blueprints.DeployContractTransaction(deployTo, contract, "FlowTransactionSchedulerUtils").Build()
817+
if err != nil {
818+
panic(fmt.Sprintf("failed to create FlowTransactionSchedulerUtils deploy transaction: %s", err))
819+
}
820+
txError, err = b.invokeMetaTransaction(
821+
b.ctx,
822+
Transaction(txBody, 0),
823+
)
824+
825+
env.FlowTransactionSchedulerUtilsAddress = deployTo.String()
826+
panicOnMetaInvokeErrf("failed to deploy FlowTransactionSchedulerUtils contract: %s", txError, err)
814827
}
815828

816829
func (b *bootstrapExecutor) mintInitialTokens(

fvm/evm/evm_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3211,7 +3211,7 @@ func TestEVMFileSystemContract(t *testing.T) {
32113211
testContract *TestContract,
32123212
testAccount *EOATestAccount,
32133213
) {
3214-
state, output := runFileSystemContract(ctx, vm, snapshot, testContract, testAccount, 438)
3214+
state, output := runFileSystemContract(ctx, vm, snapshot, testContract, testAccount, 10001)
32153215

32163216
require.NoError(t, output.Err)
32173217
require.NotEmpty(t, state.WriteSet)
@@ -3252,7 +3252,7 @@ func TestEVMFileSystemContract(t *testing.T) {
32523252
require.Equal(t, blockEventPayload.TotalGasUsed-feeTranferEventPayload.GasConsumed, txEventPayload.GasConsumed)
32533253
require.Empty(t, txEventPayload.ContractAddress)
32543254

3255-
require.Equal(t, 437, int(output.ComputationUsed))
3255+
require.Greater(t, int(output.ComputationUsed), 400)
32563256
},
32573257
fvm.WithExecutionEffortWeights(
32583258
environment.MainnetExecutionEffortWeights,
@@ -3288,7 +3288,7 @@ func TestEVMFileSystemContract(t *testing.T) {
32883288
require.Equal(t, uint64(0), blockEventPayload.TotalGasUsed)
32893289

32903290
// only a small amount of computation was used due to the EVM transaction never being executed
3291-
require.Equal(t, 8, int(output.ComputationUsed))
3291+
require.Less(t, int(output.ComputationUsed), 20)
32923292
},
32933293
fvm.WithExecutionEffortWeights(
32943294
environment.MainnetExecutionEffortWeights,

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ require (
5050
github.com/onflow/cadence v1.7.0
5151
github.com/onflow/crypto v0.25.3
5252
github.com/onflow/flow v0.4.15
53-
github.com/onflow/flow-core-contracts/lib/go/contracts v1.8.1
54-
github.com/onflow/flow-core-contracts/lib/go/templates v1.8.1
53+
github.com/onflow/flow-core-contracts/lib/go/contracts v1.9.0
54+
github.com/onflow/flow-core-contracts/lib/go/templates v1.9.0
5555
github.com/onflow/flow-go-sdk v1.8.2
5656
github.com/onflow/flow/protobuf/go/flow v0.4.15
5757
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -945,10 +945,10 @@ github.com/onflow/fixed-point v0.1.1 h1:j0jYZVO8VGyk1476alGudEg7XqCkeTVxb5ElRJRK
945945
github.com/onflow/fixed-point v0.1.1/go.mod h1:gJdoHqKtToKdOZbvryJvDZfcpzC7d2fyWuo3ZmLtcGY=
946946
github.com/onflow/flow v0.4.15 h1:MdrhULSE5iSYNyLCihH8DI4uab5VciVZUKDFON6zylY=
947947
github.com/onflow/flow v0.4.15/go.mod h1:lzyAYmbu1HfkZ9cfnL5/sjrrsnJiUU8fRL26CqLP7+c=
948-
github.com/onflow/flow-core-contracts/lib/go/contracts v1.8.1 h1:WU0s/4TCiJ+HMMc6RAsmSzPc/O7PecDVbugyHYHEaZQ=
949-
github.com/onflow/flow-core-contracts/lib/go/contracts v1.8.1/go.mod h1:h15J7unHnlTARjudbb0m5KO3EoHIucoBgShAqE6NoNA=
950-
github.com/onflow/flow-core-contracts/lib/go/templates v1.8.1 h1:l/sPH4Ki0Td4sB1ybKhVKHFq7ciiUcadV5RULXJl+wE=
951-
github.com/onflow/flow-core-contracts/lib/go/templates v1.8.1/go.mod h1:twSVyUt3rNrgzAmxtBX+1Gw64QlPemy17cyvnXYy1Ug=
948+
github.com/onflow/flow-core-contracts/lib/go/contracts v1.9.0 h1:m6lHp0xDdmVWbpbTpFlq6XxVrB+2J8qwnzMV30zdZeM=
949+
github.com/onflow/flow-core-contracts/lib/go/contracts v1.9.0/go.mod h1:jBDqVep0ICzhXky56YlyO4aiV2Jl/5r7wnqUPpvi7zE=
950+
github.com/onflow/flow-core-contracts/lib/go/templates v1.9.0 h1:8jn4Lxp/dpyWdgJ+5XEDUkYOf2aveObZtHtkdnYIEco=
951+
github.com/onflow/flow-core-contracts/lib/go/templates v1.9.0/go.mod h1:twSVyUt3rNrgzAmxtBX+1Gw64QlPemy17cyvnXYy1Ug=
952952
github.com/onflow/flow-evm-bridge v0.1.0 h1:7X2osvo4NnQgHj8aERUmbYtv9FateX8liotoLnPL9nM=
953953
github.com/onflow/flow-evm-bridge v0.1.0/go.mod h1:5UYwsnu6WcBNrwitGFxphCl5yq7fbWYGYuiCSTVF6pk=
954954
github.com/onflow/flow-ft/lib/go/contracts v1.0.1 h1:Ts5ob+CoCY2EjEd0W6vdLJ7hLL3SsEftzXG2JlmSe24=

insecure/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ require (
214214
github.com/onflow/atree v0.10.1 // indirect
215215
github.com/onflow/cadence v1.7.0 // indirect
216216
github.com/onflow/fixed-point v0.1.1 // indirect
217-
github.com/onflow/flow-core-contracts/lib/go/contracts v1.8.1 // indirect
218-
github.com/onflow/flow-core-contracts/lib/go/templates v1.8.1 // indirect
217+
github.com/onflow/flow-core-contracts/lib/go/contracts v1.9.0 // indirect
218+
github.com/onflow/flow-core-contracts/lib/go/templates v1.9.0 // indirect
219219
github.com/onflow/flow-evm-bridge v0.1.0 // indirect
220220
github.com/onflow/flow-ft/lib/go/contracts v1.0.1 // indirect
221221
github.com/onflow/flow-ft/lib/go/templates v1.0.1 // indirect

insecure/go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -893,10 +893,10 @@ github.com/onflow/crypto v0.25.3 h1:XQ3HtLsw8h1+pBN+NQ1JYM9mS2mVXTyg55OldaAIF7U=
893893
github.com/onflow/crypto v0.25.3/go.mod h1:+1igaXiK6Tjm9wQOBD1EGwW7bYWMUGKtwKJ/2QL/OWs=
894894
github.com/onflow/fixed-point v0.1.1 h1:j0jYZVO8VGyk1476alGudEg7XqCkeTVxb5ElRJRKS90=
895895
github.com/onflow/fixed-point v0.1.1/go.mod h1:gJdoHqKtToKdOZbvryJvDZfcpzC7d2fyWuo3ZmLtcGY=
896-
github.com/onflow/flow-core-contracts/lib/go/contracts v1.8.1 h1:WU0s/4TCiJ+HMMc6RAsmSzPc/O7PecDVbugyHYHEaZQ=
897-
github.com/onflow/flow-core-contracts/lib/go/contracts v1.8.1/go.mod h1:h15J7unHnlTARjudbb0m5KO3EoHIucoBgShAqE6NoNA=
898-
github.com/onflow/flow-core-contracts/lib/go/templates v1.8.1 h1:l/sPH4Ki0Td4sB1ybKhVKHFq7ciiUcadV5RULXJl+wE=
899-
github.com/onflow/flow-core-contracts/lib/go/templates v1.8.1/go.mod h1:twSVyUt3rNrgzAmxtBX+1Gw64QlPemy17cyvnXYy1Ug=
896+
github.com/onflow/flow-core-contracts/lib/go/contracts v1.9.0 h1:m6lHp0xDdmVWbpbTpFlq6XxVrB+2J8qwnzMV30zdZeM=
897+
github.com/onflow/flow-core-contracts/lib/go/contracts v1.9.0/go.mod h1:jBDqVep0ICzhXky56YlyO4aiV2Jl/5r7wnqUPpvi7zE=
898+
github.com/onflow/flow-core-contracts/lib/go/templates v1.9.0 h1:8jn4Lxp/dpyWdgJ+5XEDUkYOf2aveObZtHtkdnYIEco=
899+
github.com/onflow/flow-core-contracts/lib/go/templates v1.9.0/go.mod h1:twSVyUt3rNrgzAmxtBX+1Gw64QlPemy17cyvnXYy1Ug=
900900
github.com/onflow/flow-evm-bridge v0.1.0 h1:7X2osvo4NnQgHj8aERUmbYtv9FateX8liotoLnPL9nM=
901901
github.com/onflow/flow-evm-bridge v0.1.0/go.mod h1:5UYwsnu6WcBNrwitGFxphCl5yq7fbWYGYuiCSTVF6pk=
902902
github.com/onflow/flow-ft/lib/go/contracts v1.0.1 h1:Ts5ob+CoCY2EjEd0W6vdLJ7hLL3SsEftzXG2JlmSe24=

integration/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ require (
2222
github.com/libp2p/go-libp2p v0.38.2
2323
github.com/onflow/cadence v1.7.0
2424
github.com/onflow/crypto v0.25.3
25-
github.com/onflow/flow-core-contracts/lib/go/contracts v1.8.1
26-
github.com/onflow/flow-core-contracts/lib/go/templates v1.8.1
25+
github.com/onflow/flow-core-contracts/lib/go/contracts v1.9.0
26+
github.com/onflow/flow-core-contracts/lib/go/templates v1.9.0
2727
github.com/onflow/flow-go v0.38.0-preview.0.0.20241021221952-af9cd6e99de1
2828
github.com/onflow/flow-go-sdk v1.8.2
2929
github.com/onflow/flow-go/insecure v0.0.0-00010101000000-000000000000

integration/go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -765,10 +765,10 @@ github.com/onflow/crypto v0.25.3 h1:XQ3HtLsw8h1+pBN+NQ1JYM9mS2mVXTyg55OldaAIF7U=
765765
github.com/onflow/crypto v0.25.3/go.mod h1:+1igaXiK6Tjm9wQOBD1EGwW7bYWMUGKtwKJ/2QL/OWs=
766766
github.com/onflow/fixed-point v0.1.1 h1:j0jYZVO8VGyk1476alGudEg7XqCkeTVxb5ElRJRKS90=
767767
github.com/onflow/fixed-point v0.1.1/go.mod h1:gJdoHqKtToKdOZbvryJvDZfcpzC7d2fyWuo3ZmLtcGY=
768-
github.com/onflow/flow-core-contracts/lib/go/contracts v1.8.1 h1:WU0s/4TCiJ+HMMc6RAsmSzPc/O7PecDVbugyHYHEaZQ=
769-
github.com/onflow/flow-core-contracts/lib/go/contracts v1.8.1/go.mod h1:h15J7unHnlTARjudbb0m5KO3EoHIucoBgShAqE6NoNA=
770-
github.com/onflow/flow-core-contracts/lib/go/templates v1.8.1 h1:l/sPH4Ki0Td4sB1ybKhVKHFq7ciiUcadV5RULXJl+wE=
771-
github.com/onflow/flow-core-contracts/lib/go/templates v1.8.1/go.mod h1:twSVyUt3rNrgzAmxtBX+1Gw64QlPemy17cyvnXYy1Ug=
768+
github.com/onflow/flow-core-contracts/lib/go/contracts v1.9.0 h1:m6lHp0xDdmVWbpbTpFlq6XxVrB+2J8qwnzMV30zdZeM=
769+
github.com/onflow/flow-core-contracts/lib/go/contracts v1.9.0/go.mod h1:jBDqVep0ICzhXky56YlyO4aiV2Jl/5r7wnqUPpvi7zE=
770+
github.com/onflow/flow-core-contracts/lib/go/templates v1.9.0 h1:8jn4Lxp/dpyWdgJ+5XEDUkYOf2aveObZtHtkdnYIEco=
771+
github.com/onflow/flow-core-contracts/lib/go/templates v1.9.0/go.mod h1:twSVyUt3rNrgzAmxtBX+1Gw64QlPemy17cyvnXYy1Ug=
772772
github.com/onflow/flow-evm-bridge v0.1.0 h1:7X2osvo4NnQgHj8aERUmbYtv9FateX8liotoLnPL9nM=
773773
github.com/onflow/flow-evm-bridge v0.1.0/go.mod h1:5UYwsnu6WcBNrwitGFxphCl5yq7fbWYGYuiCSTVF6pk=
774774
github.com/onflow/flow-ft/lib/go/contracts v1.0.1 h1:Ts5ob+CoCY2EjEd0W6vdLJ7hLL3SsEftzXG2JlmSe24=

utils/unittest/execution_state.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const ServiceAccountPrivateKeySignAlgo = crypto.ECDSAP256
2323
const ServiceAccountPrivateKeyHashAlgo = hash.SHA2_256
2424

2525
// Pre-calculated state commitment with root account with the above private key
26-
const GenesisStateCommitmentHex = "1cbc19eb4f541a487a337f790da34cf12a71cfeca65f98a5c60c69e118f5387e"
26+
const GenesisStateCommitmentHex = "b8bb1b56c944902e5e0877735e2e08779a3a6385c714169473ea723a47caba83"
2727

2828
var GenesisStateCommitment flow.StateCommitment
2929

@@ -87,10 +87,10 @@ func genesisCommitHexByChainID(chainID flow.ChainID) string {
8787
return GenesisStateCommitmentHex
8888
}
8989
if chainID == flow.Testnet {
90-
return "95c2187b816a86229ece77c089de5a2ad725f1e3d85ece4d1582a7238b80daca"
90+
return "cff935133d5591fb4984d82f748b99475cd6e135f40a25e2f5084035935aac7f"
9191
}
9292
if chainID == flow.Sandboxnet {
9393
return "e1c08b17f9e5896f03fe28dd37ca396c19b26628161506924fbf785834646ea1"
9494
}
95-
return "42c5d929561c498210a94ba23bd2dd7d13412345fd45c9d0bd3f8312ae9dddd7"
95+
return "713eab04e1dea71710e79dc53ba94b1e8cbc63e7c03a9a75f24acd4a28c6a655"
9696
}

0 commit comments

Comments
 (0)