From 8ae046ccf54cb39a40fba7c0235d74456e702690 Mon Sep 17 00:00:00 2001 From: Jordan Schalm Date: Fri, 3 May 2024 13:42:09 -0400 Subject: [PATCH 1/6] remove option to disable service event collection --- .../computation/computer/computer.go | 1 - .../computation/computer/computer_test.go | 1 - fvm/context.go | 11 +---- fvm/environment/event_emitter.go | 49 +++++++++---------- fvm/environment/event_emitter_test.go | 5 +- 5 files changed, 27 insertions(+), 40 deletions(-) diff --git a/engine/execution/computation/computer/computer.go b/engine/execution/computation/computer/computer.go index 437e3816db1..ca9900acfbd 100644 --- a/engine/execution/computation/computer/computer.go +++ b/engine/execution/computation/computer/computer.go @@ -126,7 +126,6 @@ func SystemChunkContext(vmCtx fvm.Context) fvm.Context { fvm.WithAuthorizationChecksEnabled(false), fvm.WithSequenceNumberCheckAndIncrementEnabled(false), fvm.WithTransactionFeesEnabled(false), - fvm.WithServiceEventCollectionEnabled(), fvm.WithEventCollectionSizeLimit(SystemChunkEventCollectionMaxSize), fvm.WithMemoryAndInteractionLimitsDisabled(), // only the system transaction is allowed to call the block entropy provider diff --git a/engine/execution/computation/computer/computer_test.go b/engine/execution/computation/computer/computer_test.go index 06b36a4451b..015622b84ba 100644 --- a/engine/execution/computation/computer/computer_test.go +++ b/engine/execution/computation/computer/computer_test.go @@ -588,7 +588,6 @@ func TestBlockExecutor_ExecuteBlock(t *testing.T) { t.Run( "service events are emitted", func(t *testing.T) { execCtx := fvm.NewContext( - fvm.WithServiceEventCollectionEnabled(), fvm.WithAuthorizationChecksEnabled(false), fvm.WithSequenceNumberCheckAndIncrementEnabled(false), ) diff --git a/fvm/context.go b/fvm/context.go index c1b0dd09d32..128bfccb7e0 100644 --- a/fvm/context.go +++ b/fvm/context.go @@ -67,7 +67,7 @@ func newContext(ctx Context, opts ...Option) Context { } func defaultContext() Context { - return Context{ + ctx := Context{ DisableMemoryAndInteractionLimits: false, ComputationLimit: DefaultComputationLimit, MemoryLimit: DefaultMemoryLimit, @@ -77,6 +77,7 @@ func defaultContext() Context { TransactionExecutorParams: DefaultTransactionExecutorParams(), EnvironmentParams: environment.DefaultEnvironmentParams(), } + return ctx } // An Option sets a configuration parameter for a virtual machine context. @@ -185,14 +186,6 @@ func WithBlockHeader(header *flow.Header) Option { } } -// WithServiceEventCollectionEnabled enables service event collection -func WithServiceEventCollectionEnabled() Option { - return func(ctx Context) Context { - ctx.ServiceEventCollectionEnabled = true - return ctx - } -} - // WithBlocks sets the block storage provider for a virtual machine context. // // The VM uses the block storage provider to provide historical block information to diff --git a/fvm/environment/event_emitter.go b/fvm/environment/event_emitter.go index acc491ae986..46b68b05325 100644 --- a/fvm/environment/event_emitter.go +++ b/fvm/environment/event_emitter.go @@ -19,16 +19,14 @@ const ( ) type EventEmitterParams struct { - ServiceEventCollectionEnabled bool - EventCollectionByteSizeLimit uint64 - EventEncoder EventEncoder + EventCollectionByteSizeLimit uint64 + EventEncoder EventEncoder } func DefaultEventEmitterParams() EventEmitterParams { return EventEmitterParams{ - ServiceEventCollectionEnabled: false, - EventCollectionByteSizeLimit: DefaultEventCollectionByteSizeLimit, - EventEncoder: NewCadenceEventEncoder(), + EventCollectionByteSizeLimit: DefaultEventCollectionByteSizeLimit, + EventEncoder: NewCadenceEventEncoder(), } } @@ -191,27 +189,24 @@ func (emitter *eventEmitter) EmitEvent(event cadence.Event) error { // TODO: to set limit to maximum when it is service account and get rid of this flag isServiceAccount := emitter.payer == emitter.chain.ServiceAddress() - if emitter.ServiceEventCollectionEnabled { - ok, err := IsServiceEvent(eventType, emitter.chain.ChainID()) - if err != nil { - return fmt.Errorf("unable to check service event: %w", err) - } - if ok { - eventEmitError := emitter.eventCollection.AppendServiceEvent( - emitter.chain, - flowEvent, - uint64(payloadSize)) - - // skip limit if payer is service account - // TODO skip only limit-related errors - if !isServiceAccount && eventEmitError != nil { - return eventEmitError - } + isServiceEvent, err := IsServiceEvent(eventType, emitter.chain.ChainID()) + if err != nil { + return fmt.Errorf("unable to check service event: %w", err) + } + if isServiceEvent { + eventEmitError := emitter.eventCollection.AppendServiceEvent( + emitter.chain, + flowEvent, + uint64(payloadSize)) + + // skip limit if payer is service account + // TODO skip only limit-related errors + if !isServiceAccount && eventEmitError != nil { + return eventEmitError } - // We don't return and append the service event into event collection - // as well. } + // Regardless of whether it is a service event, add to eventCollection eventEmitError := emitter.eventCollection.AppendEvent(flowEvent, uint64(payloadSize)) // skip limit if payer is service account if !isServiceAccount { @@ -295,8 +290,10 @@ func (collection *EventCollection) TotalEventCounter() uint32 { return collection.eventCounter } -// IsServiceEvent determines whether or not an emitted Cadence event is -// considered a service event for the given chain. +// IsServiceEvent determines whether an emitted Cadence event is considered a service event for the given chain. +// An event is a service event if it is defined in the `systemcontracts` package allow-list. +// All service events must be defined in system contracts. +// Service events may func IsServiceEvent(eventType flow.EventType, chain flow.ChainID) (bool, error) { // retrieve the service event information for this chain diff --git a/fvm/environment/event_emitter_test.go b/fvm/environment/event_emitter_test.go index 5f188ecd6f6..56b52c4dbb0 100644 --- a/fvm/environment/event_emitter_test.go +++ b/fvm/environment/event_emitter_test.go @@ -175,9 +175,8 @@ func createTestEventEmitterWithLimit(chain flow.ChainID, address flow.Address, e }, }, environment.EventEmitterParams{ - ServiceEventCollectionEnabled: false, - EventCollectionByteSizeLimit: eventEmitLimit, - EventEncoder: environment.NewCadenceEventEncoder(), + EventCollectionByteSizeLimit: eventEmitLimit, + EventEncoder: environment.NewCadenceEventEncoder(), }, ) } From f5e878b2ca82ec12c9ebda42b59c6e689f575bbf Mon Sep 17 00:00:00 2001 From: Jordan Schalm Date: Tue, 7 May 2024 13:01:05 -0400 Subject: [PATCH 2/6] pull in direct service event and re-enable test - https://github.com/onflow/flow-core-contracts/pull/419 --- go.mod | 12 +++++----- go.sum | 24 +++++++++---------- insecure/go.mod | 12 +++++----- insecure/go.sum | 24 +++++++++---------- integration/go.mod | 12 +++++----- integration/go.sum | 24 +++++++++---------- .../upgrades/protocol_version_upgrade_test.go | 3 +-- .../templates/set-protocol-state-version.cdc | 4 ++-- 8 files changed, 57 insertions(+), 58 deletions(-) diff --git a/go.mod b/go.mod index d18bd7d2ad4..ff5aa3a33f7 100644 --- a/go.mod +++ b/go.mod @@ -50,8 +50,8 @@ require ( github.com/onflow/cadence v1.0.0-preview.25 github.com/onflow/crypto v0.25.1 github.com/onflow/flow v0.3.4 - github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240429192223-e696a8e439b5 - github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240429192223-e696a8e439b5 + github.com/onflow/flow-core-contracts/lib/go/contracts v1.0.1-0.20240507163519-1face7decbc1 + github.com/onflow/flow-core-contracts/lib/go/templates v1.0.1-0.20240507163519-1face7decbc1 github.com/onflow/flow-go-sdk v1.0.0-preview.25 github.com/onflow/flow/protobuf/go/flow v0.4.1-0.20240412170550-911321113030 github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 @@ -252,10 +252,10 @@ require ( github.com/multiformats/go-varint v0.0.7 // indirect github.com/nxadm/tail v1.4.8 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect - github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240424211859-3ff4c0fe2a1e // indirect - github.com/onflow/flow-ft/lib/go/templates v0.7.1-0.20240424211859-3ff4c0fe2a1e // indirect - github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240429184308-40c3de711140 // indirect - github.com/onflow/flow-nft/lib/go/templates v0.0.0-20240429184308-40c3de711140 // indirect + github.com/onflow/flow-ft/lib/go/contracts v1.0.0 // indirect + github.com/onflow/flow-ft/lib/go/templates v1.0.0 // indirect + github.com/onflow/flow-nft/lib/go/contracts v1.2.0 // indirect + github.com/onflow/flow-nft/lib/go/templates v1.2.0 // indirect github.com/onflow/sdks v0.5.1-0.20230912225508-b35402f12bba // indirect github.com/onsi/ginkgo/v2 v2.13.2 // indirect github.com/opencontainers/runtime-spec v1.1.0 // indirect diff --git a/go.sum b/go.sum index 2d86e8a62f3..340e0e2344e 100644 --- a/go.sum +++ b/go.sum @@ -2164,21 +2164,21 @@ github.com/onflow/crypto v0.25.1 h1:0txy2PKPMM873JbpxQNbJmuOJtD56bfs48RQfm0ts5A= github.com/onflow/crypto v0.25.1/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI= github.com/onflow/flow v0.3.4 h1:FXUWVdYB90f/rjNcY0Owo30gL790tiYff9Pb/sycXYE= github.com/onflow/flow v0.3.4/go.mod h1:lzyAYmbu1HfkZ9cfnL5/sjrrsnJiUU8fRL26CqLP7+c= -github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240429192223-e696a8e439b5 h1:by3a+8p2kUUjnxfbRYRd78bDEeXAc3PK2LzyBEQqkV4= -github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240429192223-e696a8e439b5/go.mod h1:+4JWLclBOT+emyBh6NAZSEbqEwzHcWHpIbfsXmRASgY= -github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240429192223-e696a8e439b5 h1:6Cg0h+8Iyy/Nnefk5j0gdeVoMTNpUooAMjyV8sk6zoA= -github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240429192223-e696a8e439b5/go.mod h1:0oTx6Nkc+LdOXaZe3PRtV1cY+J5z5ig08alR8d+OPHs= -github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240424211859-3ff4c0fe2a1e h1:2LO6Rtmz2PVfH+ZXnMwvTwVeIz3PCy0fs3lQraqog14= -github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240424211859-3ff4c0fe2a1e/go.mod h1:PwsL8fC81cjnUnTfmyL/HOIyHnyaw/JA474Wfj2tl6A= -github.com/onflow/flow-ft/lib/go/templates v0.7.1-0.20240424211859-3ff4c0fe2a1e h1:jl7SYAui/gYRmBofrY//Ln8ixRJwvLzvwLstNfRKmWY= -github.com/onflow/flow-ft/lib/go/templates v0.7.1-0.20240424211859-3ff4c0fe2a1e/go.mod h1:uQ8XFqmMK2jxyBSVrmyuwdWjTEb+6zGjRYotfDJ5pAE= +github.com/onflow/flow-core-contracts/lib/go/contracts v1.0.1-0.20240507163519-1face7decbc1 h1:Odgoma4opYOuGKUfKYd5Zus9/R6euE1A3tdlClwCUrs= +github.com/onflow/flow-core-contracts/lib/go/contracts v1.0.1-0.20240507163519-1face7decbc1/go.mod h1:ACen33wxzi3AsptCw/1rQ4McV5LumEhK0cC17RFG4o0= +github.com/onflow/flow-core-contracts/lib/go/templates v1.0.1-0.20240507163519-1face7decbc1 h1:xWrEpO1cLk3VHrReiHkniJ1fJ4+br1aPWKxMd0fH2dM= +github.com/onflow/flow-core-contracts/lib/go/templates v1.0.1-0.20240507163519-1face7decbc1/go.mod h1:NgbMOYnMh0GN48VsNKZuiwK7uyk38Wyo8jN9+C9QE30= +github.com/onflow/flow-ft/lib/go/contracts v1.0.0 h1:mToacZ5NWqtlWwk/7RgIl/jeKB/Sy/tIXdw90yKHcV0= +github.com/onflow/flow-ft/lib/go/contracts v1.0.0/go.mod h1:PwsL8fC81cjnUnTfmyL/HOIyHnyaw/JA474Wfj2tl6A= +github.com/onflow/flow-ft/lib/go/templates v1.0.0 h1:6cMS/lUJJ17HjKBfMO/eh0GGvnpElPgBXx7h5aoWJhs= +github.com/onflow/flow-ft/lib/go/templates v1.0.0/go.mod h1:uQ8XFqmMK2jxyBSVrmyuwdWjTEb+6zGjRYotfDJ5pAE= github.com/onflow/flow-go-sdk v1.0.0-M1/go.mod h1:TDW0MNuCs4SvqYRUzkbRnRmHQL1h4X8wURsCw9P9beo= github.com/onflow/flow-go-sdk v1.0.0-preview.25 h1:wL/+cK7oxSww31qSqTpt1Yfr26c8hJ8YHh9nIdq6PlI= github.com/onflow/flow-go-sdk v1.0.0-preview.25/go.mod h1:Px1fQdB7WFC0yhYsEM3rhKzuE+Zi8GpBjR4qVuDAwMA= -github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240429184308-40c3de711140 h1:oTj4RGgfuJSSBE1aDVrlh6avxKBMraucpNtRg0K+yhg= -github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240429184308-40c3de711140/go.mod h1:2gpbza+uzs1k7x31hkpBPlggIRkI53Suo0n2AyA2HcE= -github.com/onflow/flow-nft/lib/go/templates v0.0.0-20240429184308-40c3de711140 h1:7NwSIG4SEdm+96gr+Aaqx291jZ/Bqkxk/ghVnens9CU= -github.com/onflow/flow-nft/lib/go/templates v0.0.0-20240429184308-40c3de711140/go.mod h1:p+2hRvtjLUR3MW1NsoJe5Gqgr2eeH49QB6+s6ze00w0= +github.com/onflow/flow-nft/lib/go/contracts v1.2.0 h1:TFH7GCJKcGi0+x14SCvF7Gbnxp68gJOGNV8PSIAM2J0= +github.com/onflow/flow-nft/lib/go/contracts v1.2.0/go.mod h1:2gpbza+uzs1k7x31hkpBPlggIRkI53Suo0n2AyA2HcE= +github.com/onflow/flow-nft/lib/go/templates v1.2.0 h1:JSQyh9rg0RC+D1930BiRXN8lrtMs+ubVMK6aQPon6Yc= +github.com/onflow/flow-nft/lib/go/templates v1.2.0/go.mod h1:p+2hRvtjLUR3MW1NsoJe5Gqgr2eeH49QB6+s6ze00w0= github.com/onflow/flow/protobuf/go/flow v0.3.2-0.20231121210617-52ee94b830c2/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk= github.com/onflow/flow/protobuf/go/flow v0.4.1-0.20240412170550-911321113030 h1:I+aosSiJny88O4p3nPbCiUcp/UqN6AepvO6uj82bjH0= github.com/onflow/flow/protobuf/go/flow v0.4.1-0.20240412170550-911321113030/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk= diff --git a/insecure/go.mod b/insecure/go.mod index e2e4c9a34a5..66f43867adf 100644 --- a/insecure/go.mod +++ b/insecure/go.mod @@ -199,13 +199,13 @@ require ( github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/onflow/atree v0.7.0-rc.1 // indirect github.com/onflow/cadence v1.0.0-preview.25 // indirect - github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240429192223-e696a8e439b5 // indirect - github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240429192223-e696a8e439b5 // indirect - github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240424211859-3ff4c0fe2a1e // indirect - github.com/onflow/flow-ft/lib/go/templates v0.7.1-0.20240424211859-3ff4c0fe2a1e // indirect + github.com/onflow/flow-core-contracts/lib/go/contracts v1.0.1-0.20240507163519-1face7decbc1 // indirect + github.com/onflow/flow-core-contracts/lib/go/templates v1.0.1-0.20240507163519-1face7decbc1 // indirect + github.com/onflow/flow-ft/lib/go/contracts v1.0.0 // indirect + github.com/onflow/flow-ft/lib/go/templates v1.0.0 // indirect github.com/onflow/flow-go-sdk v1.0.0-preview.25 // indirect - github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240429184308-40c3de711140 // indirect - github.com/onflow/flow-nft/lib/go/templates v0.0.0-20240429184308-40c3de711140 // indirect + github.com/onflow/flow-nft/lib/go/contracts v1.2.0 // indirect + github.com/onflow/flow-nft/lib/go/templates v1.2.0 // indirect github.com/onflow/flow/protobuf/go/flow v0.4.1-0.20240412170550-911321113030 // indirect github.com/onflow/go-ethereum v1.13.4 // indirect github.com/onflow/sdks v0.5.1-0.20230912225508-b35402f12bba // indirect diff --git a/insecure/go.sum b/insecure/go.sum index 2232313db43..eff31a8db44 100644 --- a/insecure/go.sum +++ b/insecure/go.sum @@ -2148,21 +2148,21 @@ github.com/onflow/cadence v1.0.0-preview.25/go.mod h1:fGhLBbuEmv5rh48qv0ZS0tUz53 github.com/onflow/crypto v0.25.0/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI= github.com/onflow/crypto v0.25.1 h1:0txy2PKPMM873JbpxQNbJmuOJtD56bfs48RQfm0ts5A= github.com/onflow/crypto v0.25.1/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI= -github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240429192223-e696a8e439b5 h1:by3a+8p2kUUjnxfbRYRd78bDEeXAc3PK2LzyBEQqkV4= -github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240429192223-e696a8e439b5/go.mod h1:+4JWLclBOT+emyBh6NAZSEbqEwzHcWHpIbfsXmRASgY= -github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240429192223-e696a8e439b5 h1:6Cg0h+8Iyy/Nnefk5j0gdeVoMTNpUooAMjyV8sk6zoA= -github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240429192223-e696a8e439b5/go.mod h1:0oTx6Nkc+LdOXaZe3PRtV1cY+J5z5ig08alR8d+OPHs= -github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240424211859-3ff4c0fe2a1e h1:2LO6Rtmz2PVfH+ZXnMwvTwVeIz3PCy0fs3lQraqog14= -github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240424211859-3ff4c0fe2a1e/go.mod h1:PwsL8fC81cjnUnTfmyL/HOIyHnyaw/JA474Wfj2tl6A= -github.com/onflow/flow-ft/lib/go/templates v0.7.1-0.20240424211859-3ff4c0fe2a1e h1:jl7SYAui/gYRmBofrY//Ln8ixRJwvLzvwLstNfRKmWY= -github.com/onflow/flow-ft/lib/go/templates v0.7.1-0.20240424211859-3ff4c0fe2a1e/go.mod h1:uQ8XFqmMK2jxyBSVrmyuwdWjTEb+6zGjRYotfDJ5pAE= +github.com/onflow/flow-core-contracts/lib/go/contracts v1.0.1-0.20240507163519-1face7decbc1 h1:Odgoma4opYOuGKUfKYd5Zus9/R6euE1A3tdlClwCUrs= +github.com/onflow/flow-core-contracts/lib/go/contracts v1.0.1-0.20240507163519-1face7decbc1/go.mod h1:ACen33wxzi3AsptCw/1rQ4McV5LumEhK0cC17RFG4o0= +github.com/onflow/flow-core-contracts/lib/go/templates v1.0.1-0.20240507163519-1face7decbc1 h1:xWrEpO1cLk3VHrReiHkniJ1fJ4+br1aPWKxMd0fH2dM= +github.com/onflow/flow-core-contracts/lib/go/templates v1.0.1-0.20240507163519-1face7decbc1/go.mod h1:NgbMOYnMh0GN48VsNKZuiwK7uyk38Wyo8jN9+C9QE30= +github.com/onflow/flow-ft/lib/go/contracts v1.0.0 h1:mToacZ5NWqtlWwk/7RgIl/jeKB/Sy/tIXdw90yKHcV0= +github.com/onflow/flow-ft/lib/go/contracts v1.0.0/go.mod h1:PwsL8fC81cjnUnTfmyL/HOIyHnyaw/JA474Wfj2tl6A= +github.com/onflow/flow-ft/lib/go/templates v1.0.0 h1:6cMS/lUJJ17HjKBfMO/eh0GGvnpElPgBXx7h5aoWJhs= +github.com/onflow/flow-ft/lib/go/templates v1.0.0/go.mod h1:uQ8XFqmMK2jxyBSVrmyuwdWjTEb+6zGjRYotfDJ5pAE= github.com/onflow/flow-go-sdk v1.0.0-M1/go.mod h1:TDW0MNuCs4SvqYRUzkbRnRmHQL1h4X8wURsCw9P9beo= github.com/onflow/flow-go-sdk v1.0.0-preview.25 h1:wL/+cK7oxSww31qSqTpt1Yfr26c8hJ8YHh9nIdq6PlI= github.com/onflow/flow-go-sdk v1.0.0-preview.25/go.mod h1:Px1fQdB7WFC0yhYsEM3rhKzuE+Zi8GpBjR4qVuDAwMA= -github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240429184308-40c3de711140 h1:oTj4RGgfuJSSBE1aDVrlh6avxKBMraucpNtRg0K+yhg= -github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240429184308-40c3de711140/go.mod h1:2gpbza+uzs1k7x31hkpBPlggIRkI53Suo0n2AyA2HcE= -github.com/onflow/flow-nft/lib/go/templates v0.0.0-20240429184308-40c3de711140 h1:7NwSIG4SEdm+96gr+Aaqx291jZ/Bqkxk/ghVnens9CU= -github.com/onflow/flow-nft/lib/go/templates v0.0.0-20240429184308-40c3de711140/go.mod h1:p+2hRvtjLUR3MW1NsoJe5Gqgr2eeH49QB6+s6ze00w0= +github.com/onflow/flow-nft/lib/go/contracts v1.2.0 h1:TFH7GCJKcGi0+x14SCvF7Gbnxp68gJOGNV8PSIAM2J0= +github.com/onflow/flow-nft/lib/go/contracts v1.2.0/go.mod h1:2gpbza+uzs1k7x31hkpBPlggIRkI53Suo0n2AyA2HcE= +github.com/onflow/flow-nft/lib/go/templates v1.2.0 h1:JSQyh9rg0RC+D1930BiRXN8lrtMs+ubVMK6aQPon6Yc= +github.com/onflow/flow-nft/lib/go/templates v1.2.0/go.mod h1:p+2hRvtjLUR3MW1NsoJe5Gqgr2eeH49QB6+s6ze00w0= github.com/onflow/flow/protobuf/go/flow v0.3.2-0.20231121210617-52ee94b830c2/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk= github.com/onflow/flow/protobuf/go/flow v0.4.1-0.20240412170550-911321113030 h1:I+aosSiJny88O4p3nPbCiUcp/UqN6AepvO6uj82bjH0= github.com/onflow/flow/protobuf/go/flow v0.4.1-0.20240412170550-911321113030/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk= diff --git a/integration/go.mod b/integration/go.mod index 14865650170..ef16d2e3469 100644 --- a/integration/go.mod +++ b/integration/go.mod @@ -21,8 +21,8 @@ require ( github.com/libp2p/go-libp2p v0.32.2 github.com/onflow/cadence v1.0.0-preview.25 github.com/onflow/crypto v0.25.1 - github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240429192223-e696a8e439b5 - github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240429192223-e696a8e439b5 + github.com/onflow/flow-core-contracts/lib/go/contracts v1.0.1-0.20240507163519-1face7decbc1 + github.com/onflow/flow-core-contracts/lib/go/templates v1.0.1-0.20240507163519-1face7decbc1 github.com/onflow/flow-emulator v1.0.0-preview.21.0.20240501034320-e644fcba11e2 github.com/onflow/flow-go v0.34.0-crescendo-preview.10-staged-contracts-3.0.20240501031941-53ca114d9c37 github.com/onflow/flow-go-sdk v1.0.0-preview.25 @@ -242,10 +242,10 @@ require ( github.com/multiformats/go-varint v0.0.7 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/onflow/atree v0.7.0-rc.1 // indirect - github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240424211859-3ff4c0fe2a1e // indirect - github.com/onflow/flow-ft/lib/go/templates v0.7.1-0.20240424211859-3ff4c0fe2a1e // indirect - github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240429184308-40c3de711140 // indirect - github.com/onflow/flow-nft/lib/go/templates v0.0.0-20240429184308-40c3de711140 // indirect + github.com/onflow/flow-ft/lib/go/contracts v1.0.0 // indirect + github.com/onflow/flow-ft/lib/go/templates v1.0.0 // indirect + github.com/onflow/flow-nft/lib/go/contracts v1.2.0 // indirect + github.com/onflow/flow-nft/lib/go/templates v1.2.0 // indirect github.com/onflow/sdks v0.5.1-0.20230912225508-b35402f12bba // indirect github.com/onflow/wal v0.0.0-20240208022732-d756cd497d3b // indirect github.com/onsi/ginkgo/v2 v2.13.2 // indirect diff --git a/integration/go.sum b/integration/go.sum index 51194079f68..e4c4ed5c2cc 100644 --- a/integration/go.sum +++ b/integration/go.sum @@ -2142,23 +2142,23 @@ github.com/onflow/cadence v1.0.0-preview.25/go.mod h1:fGhLBbuEmv5rh48qv0ZS0tUz53 github.com/onflow/crypto v0.25.0/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI= github.com/onflow/crypto v0.25.1 h1:0txy2PKPMM873JbpxQNbJmuOJtD56bfs48RQfm0ts5A= github.com/onflow/crypto v0.25.1/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI= -github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240429192223-e696a8e439b5 h1:by3a+8p2kUUjnxfbRYRd78bDEeXAc3PK2LzyBEQqkV4= -github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240429192223-e696a8e439b5/go.mod h1:+4JWLclBOT+emyBh6NAZSEbqEwzHcWHpIbfsXmRASgY= -github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240429192223-e696a8e439b5 h1:6Cg0h+8Iyy/Nnefk5j0gdeVoMTNpUooAMjyV8sk6zoA= -github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240429192223-e696a8e439b5/go.mod h1:0oTx6Nkc+LdOXaZe3PRtV1cY+J5z5ig08alR8d+OPHs= +github.com/onflow/flow-core-contracts/lib/go/contracts v1.0.1-0.20240507163519-1face7decbc1 h1:Odgoma4opYOuGKUfKYd5Zus9/R6euE1A3tdlClwCUrs= +github.com/onflow/flow-core-contracts/lib/go/contracts v1.0.1-0.20240507163519-1face7decbc1/go.mod h1:ACen33wxzi3AsptCw/1rQ4McV5LumEhK0cC17RFG4o0= +github.com/onflow/flow-core-contracts/lib/go/templates v1.0.1-0.20240507163519-1face7decbc1 h1:xWrEpO1cLk3VHrReiHkniJ1fJ4+br1aPWKxMd0fH2dM= +github.com/onflow/flow-core-contracts/lib/go/templates v1.0.1-0.20240507163519-1face7decbc1/go.mod h1:NgbMOYnMh0GN48VsNKZuiwK7uyk38Wyo8jN9+C9QE30= github.com/onflow/flow-emulator v1.0.0-preview.21.0.20240501034320-e644fcba11e2 h1:BMT/YaJMrj0F6DQ/zdxvrzR9OUvt8QeiORoCEjaCm5Q= github.com/onflow/flow-emulator v1.0.0-preview.21.0.20240501034320-e644fcba11e2/go.mod h1:6YYaVcM+47UrZUgd5Jgh7KMWEx1k2gGqW0iS1RPE9+I= -github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240424211859-3ff4c0fe2a1e h1:2LO6Rtmz2PVfH+ZXnMwvTwVeIz3PCy0fs3lQraqog14= -github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240424211859-3ff4c0fe2a1e/go.mod h1:PwsL8fC81cjnUnTfmyL/HOIyHnyaw/JA474Wfj2tl6A= -github.com/onflow/flow-ft/lib/go/templates v0.7.1-0.20240424211859-3ff4c0fe2a1e h1:jl7SYAui/gYRmBofrY//Ln8ixRJwvLzvwLstNfRKmWY= -github.com/onflow/flow-ft/lib/go/templates v0.7.1-0.20240424211859-3ff4c0fe2a1e/go.mod h1:uQ8XFqmMK2jxyBSVrmyuwdWjTEb+6zGjRYotfDJ5pAE= +github.com/onflow/flow-ft/lib/go/contracts v1.0.0 h1:mToacZ5NWqtlWwk/7RgIl/jeKB/Sy/tIXdw90yKHcV0= +github.com/onflow/flow-ft/lib/go/contracts v1.0.0/go.mod h1:PwsL8fC81cjnUnTfmyL/HOIyHnyaw/JA474Wfj2tl6A= +github.com/onflow/flow-ft/lib/go/templates v1.0.0 h1:6cMS/lUJJ17HjKBfMO/eh0GGvnpElPgBXx7h5aoWJhs= +github.com/onflow/flow-ft/lib/go/templates v1.0.0/go.mod h1:uQ8XFqmMK2jxyBSVrmyuwdWjTEb+6zGjRYotfDJ5pAE= github.com/onflow/flow-go-sdk v1.0.0-M1/go.mod h1:TDW0MNuCs4SvqYRUzkbRnRmHQL1h4X8wURsCw9P9beo= github.com/onflow/flow-go-sdk v1.0.0-preview.25 h1:wL/+cK7oxSww31qSqTpt1Yfr26c8hJ8YHh9nIdq6PlI= github.com/onflow/flow-go-sdk v1.0.0-preview.25/go.mod h1:Px1fQdB7WFC0yhYsEM3rhKzuE+Zi8GpBjR4qVuDAwMA= -github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240429184308-40c3de711140 h1:oTj4RGgfuJSSBE1aDVrlh6avxKBMraucpNtRg0K+yhg= -github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240429184308-40c3de711140/go.mod h1:2gpbza+uzs1k7x31hkpBPlggIRkI53Suo0n2AyA2HcE= -github.com/onflow/flow-nft/lib/go/templates v0.0.0-20240429184308-40c3de711140 h1:7NwSIG4SEdm+96gr+Aaqx291jZ/Bqkxk/ghVnens9CU= -github.com/onflow/flow-nft/lib/go/templates v0.0.0-20240429184308-40c3de711140/go.mod h1:p+2hRvtjLUR3MW1NsoJe5Gqgr2eeH49QB6+s6ze00w0= +github.com/onflow/flow-nft/lib/go/contracts v1.2.0 h1:TFH7GCJKcGi0+x14SCvF7Gbnxp68gJOGNV8PSIAM2J0= +github.com/onflow/flow-nft/lib/go/contracts v1.2.0/go.mod h1:2gpbza+uzs1k7x31hkpBPlggIRkI53Suo0n2AyA2HcE= +github.com/onflow/flow-nft/lib/go/templates v1.2.0 h1:JSQyh9rg0RC+D1930BiRXN8lrtMs+ubVMK6aQPon6Yc= +github.com/onflow/flow-nft/lib/go/templates v1.2.0/go.mod h1:p+2hRvtjLUR3MW1NsoJe5Gqgr2eeH49QB6+s6ze00w0= github.com/onflow/flow/protobuf/go/flow v0.3.2-0.20231121210617-52ee94b830c2/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk= github.com/onflow/flow/protobuf/go/flow v0.4.1-0.20240412170550-911321113030 h1:I+aosSiJny88O4p3nPbCiUcp/UqN6AepvO6uj82bjH0= github.com/onflow/flow/protobuf/go/flow v0.4.1-0.20240412170550-911321113030/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk= diff --git a/integration/tests/upgrades/protocol_version_upgrade_test.go b/integration/tests/upgrades/protocol_version_upgrade_test.go index 303ee495919..bc4ecb499e0 100644 --- a/integration/tests/upgrades/protocol_version_upgrade_test.go +++ b/integration/tests/upgrades/protocol_version_upgrade_test.go @@ -16,7 +16,6 @@ import ( "github.com/onflow/flow-go/integration/utils" "github.com/onflow/flow-go/model/flow" "github.com/onflow/flow-go/state/protocol/protocol_state/kvstore" - "github.com/onflow/flow-go/utils/unittest" ) type ProtocolVersionUpgradeSuite struct { @@ -26,7 +25,7 @@ type ProtocolVersionUpgradeSuite struct { func TestProtocolVersionUpgrade(t *testing.T) { // See https://github.com/onflow/flow-go/pull/5840/files#r1589483631 // Must merge and pin https://github.com/onflow/flow-core-contracts/pull/419 to re-enable test - unittest.SkipUnless(t, unittest.TEST_TODO, "skipped as it depends on VersionBeacon contract upgrade") + //unittest.SkipUnless(t, unittest.TEST_TODO, "skipped as it depends on VersionBeacon contract upgrade") suite.Run(t, new(ProtocolVersionUpgradeSuite)) } diff --git a/integration/utils/templates/set-protocol-state-version.cdc b/integration/utils/templates/set-protocol-state-version.cdc index 1a6cca1854d..e69b5fc4812 100644 --- a/integration/utils/templates/set-protocol-state-version.cdc +++ b/integration/utils/templates/set-protocol-state-version.cdc @@ -1,4 +1,4 @@ -import NodeVersionBeacon from 0xNODEVERSIONBEACONADDRESS +import NodeVersionBeacon from "NodeVersionBeacon" /// Transaction that allows NodeVersionAdmin to specify a new protocol state version. /// The new version will become active at view `activeView` if the service event @@ -22,7 +22,7 @@ transaction(newProtocolVersion: UInt64, activeViewDiff: UInt64) { execute { let block = getCurrentBlock() - self.adminRef.setPendingProtocolStateVersionUpgrade( + self.adminRef.emitProtocolStateVersionUpgrade( newProtocolVersion: newProtocolVersion, activeView: block.view + activeViewDiff ) From 1dec2552633a26bb02ccfa53baced5c1357c6416 Mon Sep 17 00:00:00 2001 From: Jordan Schalm Date: Tue, 7 May 2024 14:18:07 -0400 Subject: [PATCH 3/6] Revert "pull in direct service event and re-enable test" This reverts commit f5e878b2ca82ec12c9ebda42b59c6e689f575bbf. --- go.mod | 12 +++++----- go.sum | 24 +++++++++---------- insecure/go.mod | 12 +++++----- insecure/go.sum | 24 +++++++++---------- integration/go.mod | 12 +++++----- integration/go.sum | 24 +++++++++---------- .../upgrades/protocol_version_upgrade_test.go | 3 ++- .../templates/set-protocol-state-version.cdc | 4 ++-- 8 files changed, 58 insertions(+), 57 deletions(-) diff --git a/go.mod b/go.mod index ff5aa3a33f7..d18bd7d2ad4 100644 --- a/go.mod +++ b/go.mod @@ -50,8 +50,8 @@ require ( github.com/onflow/cadence v1.0.0-preview.25 github.com/onflow/crypto v0.25.1 github.com/onflow/flow v0.3.4 - github.com/onflow/flow-core-contracts/lib/go/contracts v1.0.1-0.20240507163519-1face7decbc1 - github.com/onflow/flow-core-contracts/lib/go/templates v1.0.1-0.20240507163519-1face7decbc1 + github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240429192223-e696a8e439b5 + github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240429192223-e696a8e439b5 github.com/onflow/flow-go-sdk v1.0.0-preview.25 github.com/onflow/flow/protobuf/go/flow v0.4.1-0.20240412170550-911321113030 github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 @@ -252,10 +252,10 @@ require ( github.com/multiformats/go-varint v0.0.7 // indirect github.com/nxadm/tail v1.4.8 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect - github.com/onflow/flow-ft/lib/go/contracts v1.0.0 // indirect - github.com/onflow/flow-ft/lib/go/templates v1.0.0 // indirect - github.com/onflow/flow-nft/lib/go/contracts v1.2.0 // indirect - github.com/onflow/flow-nft/lib/go/templates v1.2.0 // indirect + github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240424211859-3ff4c0fe2a1e // indirect + github.com/onflow/flow-ft/lib/go/templates v0.7.1-0.20240424211859-3ff4c0fe2a1e // indirect + github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240429184308-40c3de711140 // indirect + github.com/onflow/flow-nft/lib/go/templates v0.0.0-20240429184308-40c3de711140 // indirect github.com/onflow/sdks v0.5.1-0.20230912225508-b35402f12bba // indirect github.com/onsi/ginkgo/v2 v2.13.2 // indirect github.com/opencontainers/runtime-spec v1.1.0 // indirect diff --git a/go.sum b/go.sum index 340e0e2344e..2d86e8a62f3 100644 --- a/go.sum +++ b/go.sum @@ -2164,21 +2164,21 @@ github.com/onflow/crypto v0.25.1 h1:0txy2PKPMM873JbpxQNbJmuOJtD56bfs48RQfm0ts5A= github.com/onflow/crypto v0.25.1/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI= github.com/onflow/flow v0.3.4 h1:FXUWVdYB90f/rjNcY0Owo30gL790tiYff9Pb/sycXYE= github.com/onflow/flow v0.3.4/go.mod h1:lzyAYmbu1HfkZ9cfnL5/sjrrsnJiUU8fRL26CqLP7+c= -github.com/onflow/flow-core-contracts/lib/go/contracts v1.0.1-0.20240507163519-1face7decbc1 h1:Odgoma4opYOuGKUfKYd5Zus9/R6euE1A3tdlClwCUrs= -github.com/onflow/flow-core-contracts/lib/go/contracts v1.0.1-0.20240507163519-1face7decbc1/go.mod h1:ACen33wxzi3AsptCw/1rQ4McV5LumEhK0cC17RFG4o0= -github.com/onflow/flow-core-contracts/lib/go/templates v1.0.1-0.20240507163519-1face7decbc1 h1:xWrEpO1cLk3VHrReiHkniJ1fJ4+br1aPWKxMd0fH2dM= -github.com/onflow/flow-core-contracts/lib/go/templates v1.0.1-0.20240507163519-1face7decbc1/go.mod h1:NgbMOYnMh0GN48VsNKZuiwK7uyk38Wyo8jN9+C9QE30= -github.com/onflow/flow-ft/lib/go/contracts v1.0.0 h1:mToacZ5NWqtlWwk/7RgIl/jeKB/Sy/tIXdw90yKHcV0= -github.com/onflow/flow-ft/lib/go/contracts v1.0.0/go.mod h1:PwsL8fC81cjnUnTfmyL/HOIyHnyaw/JA474Wfj2tl6A= -github.com/onflow/flow-ft/lib/go/templates v1.0.0 h1:6cMS/lUJJ17HjKBfMO/eh0GGvnpElPgBXx7h5aoWJhs= -github.com/onflow/flow-ft/lib/go/templates v1.0.0/go.mod h1:uQ8XFqmMK2jxyBSVrmyuwdWjTEb+6zGjRYotfDJ5pAE= +github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240429192223-e696a8e439b5 h1:by3a+8p2kUUjnxfbRYRd78bDEeXAc3PK2LzyBEQqkV4= +github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240429192223-e696a8e439b5/go.mod h1:+4JWLclBOT+emyBh6NAZSEbqEwzHcWHpIbfsXmRASgY= +github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240429192223-e696a8e439b5 h1:6Cg0h+8Iyy/Nnefk5j0gdeVoMTNpUooAMjyV8sk6zoA= +github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240429192223-e696a8e439b5/go.mod h1:0oTx6Nkc+LdOXaZe3PRtV1cY+J5z5ig08alR8d+OPHs= +github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240424211859-3ff4c0fe2a1e h1:2LO6Rtmz2PVfH+ZXnMwvTwVeIz3PCy0fs3lQraqog14= +github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240424211859-3ff4c0fe2a1e/go.mod h1:PwsL8fC81cjnUnTfmyL/HOIyHnyaw/JA474Wfj2tl6A= +github.com/onflow/flow-ft/lib/go/templates v0.7.1-0.20240424211859-3ff4c0fe2a1e h1:jl7SYAui/gYRmBofrY//Ln8ixRJwvLzvwLstNfRKmWY= +github.com/onflow/flow-ft/lib/go/templates v0.7.1-0.20240424211859-3ff4c0fe2a1e/go.mod h1:uQ8XFqmMK2jxyBSVrmyuwdWjTEb+6zGjRYotfDJ5pAE= github.com/onflow/flow-go-sdk v1.0.0-M1/go.mod h1:TDW0MNuCs4SvqYRUzkbRnRmHQL1h4X8wURsCw9P9beo= github.com/onflow/flow-go-sdk v1.0.0-preview.25 h1:wL/+cK7oxSww31qSqTpt1Yfr26c8hJ8YHh9nIdq6PlI= github.com/onflow/flow-go-sdk v1.0.0-preview.25/go.mod h1:Px1fQdB7WFC0yhYsEM3rhKzuE+Zi8GpBjR4qVuDAwMA= -github.com/onflow/flow-nft/lib/go/contracts v1.2.0 h1:TFH7GCJKcGi0+x14SCvF7Gbnxp68gJOGNV8PSIAM2J0= -github.com/onflow/flow-nft/lib/go/contracts v1.2.0/go.mod h1:2gpbza+uzs1k7x31hkpBPlggIRkI53Suo0n2AyA2HcE= -github.com/onflow/flow-nft/lib/go/templates v1.2.0 h1:JSQyh9rg0RC+D1930BiRXN8lrtMs+ubVMK6aQPon6Yc= -github.com/onflow/flow-nft/lib/go/templates v1.2.0/go.mod h1:p+2hRvtjLUR3MW1NsoJe5Gqgr2eeH49QB6+s6ze00w0= +github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240429184308-40c3de711140 h1:oTj4RGgfuJSSBE1aDVrlh6avxKBMraucpNtRg0K+yhg= +github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240429184308-40c3de711140/go.mod h1:2gpbza+uzs1k7x31hkpBPlggIRkI53Suo0n2AyA2HcE= +github.com/onflow/flow-nft/lib/go/templates v0.0.0-20240429184308-40c3de711140 h1:7NwSIG4SEdm+96gr+Aaqx291jZ/Bqkxk/ghVnens9CU= +github.com/onflow/flow-nft/lib/go/templates v0.0.0-20240429184308-40c3de711140/go.mod h1:p+2hRvtjLUR3MW1NsoJe5Gqgr2eeH49QB6+s6ze00w0= github.com/onflow/flow/protobuf/go/flow v0.3.2-0.20231121210617-52ee94b830c2/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk= github.com/onflow/flow/protobuf/go/flow v0.4.1-0.20240412170550-911321113030 h1:I+aosSiJny88O4p3nPbCiUcp/UqN6AepvO6uj82bjH0= github.com/onflow/flow/protobuf/go/flow v0.4.1-0.20240412170550-911321113030/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk= diff --git a/insecure/go.mod b/insecure/go.mod index 66f43867adf..e2e4c9a34a5 100644 --- a/insecure/go.mod +++ b/insecure/go.mod @@ -199,13 +199,13 @@ require ( github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/onflow/atree v0.7.0-rc.1 // indirect github.com/onflow/cadence v1.0.0-preview.25 // indirect - github.com/onflow/flow-core-contracts/lib/go/contracts v1.0.1-0.20240507163519-1face7decbc1 // indirect - github.com/onflow/flow-core-contracts/lib/go/templates v1.0.1-0.20240507163519-1face7decbc1 // indirect - github.com/onflow/flow-ft/lib/go/contracts v1.0.0 // indirect - github.com/onflow/flow-ft/lib/go/templates v1.0.0 // indirect + github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240429192223-e696a8e439b5 // indirect + github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240429192223-e696a8e439b5 // indirect + github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240424211859-3ff4c0fe2a1e // indirect + github.com/onflow/flow-ft/lib/go/templates v0.7.1-0.20240424211859-3ff4c0fe2a1e // indirect github.com/onflow/flow-go-sdk v1.0.0-preview.25 // indirect - github.com/onflow/flow-nft/lib/go/contracts v1.2.0 // indirect - github.com/onflow/flow-nft/lib/go/templates v1.2.0 // indirect + github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240429184308-40c3de711140 // indirect + github.com/onflow/flow-nft/lib/go/templates v0.0.0-20240429184308-40c3de711140 // indirect github.com/onflow/flow/protobuf/go/flow v0.4.1-0.20240412170550-911321113030 // indirect github.com/onflow/go-ethereum v1.13.4 // indirect github.com/onflow/sdks v0.5.1-0.20230912225508-b35402f12bba // indirect diff --git a/insecure/go.sum b/insecure/go.sum index eff31a8db44..2232313db43 100644 --- a/insecure/go.sum +++ b/insecure/go.sum @@ -2148,21 +2148,21 @@ github.com/onflow/cadence v1.0.0-preview.25/go.mod h1:fGhLBbuEmv5rh48qv0ZS0tUz53 github.com/onflow/crypto v0.25.0/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI= github.com/onflow/crypto v0.25.1 h1:0txy2PKPMM873JbpxQNbJmuOJtD56bfs48RQfm0ts5A= github.com/onflow/crypto v0.25.1/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI= -github.com/onflow/flow-core-contracts/lib/go/contracts v1.0.1-0.20240507163519-1face7decbc1 h1:Odgoma4opYOuGKUfKYd5Zus9/R6euE1A3tdlClwCUrs= -github.com/onflow/flow-core-contracts/lib/go/contracts v1.0.1-0.20240507163519-1face7decbc1/go.mod h1:ACen33wxzi3AsptCw/1rQ4McV5LumEhK0cC17RFG4o0= -github.com/onflow/flow-core-contracts/lib/go/templates v1.0.1-0.20240507163519-1face7decbc1 h1:xWrEpO1cLk3VHrReiHkniJ1fJ4+br1aPWKxMd0fH2dM= -github.com/onflow/flow-core-contracts/lib/go/templates v1.0.1-0.20240507163519-1face7decbc1/go.mod h1:NgbMOYnMh0GN48VsNKZuiwK7uyk38Wyo8jN9+C9QE30= -github.com/onflow/flow-ft/lib/go/contracts v1.0.0 h1:mToacZ5NWqtlWwk/7RgIl/jeKB/Sy/tIXdw90yKHcV0= -github.com/onflow/flow-ft/lib/go/contracts v1.0.0/go.mod h1:PwsL8fC81cjnUnTfmyL/HOIyHnyaw/JA474Wfj2tl6A= -github.com/onflow/flow-ft/lib/go/templates v1.0.0 h1:6cMS/lUJJ17HjKBfMO/eh0GGvnpElPgBXx7h5aoWJhs= -github.com/onflow/flow-ft/lib/go/templates v1.0.0/go.mod h1:uQ8XFqmMK2jxyBSVrmyuwdWjTEb+6zGjRYotfDJ5pAE= +github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240429192223-e696a8e439b5 h1:by3a+8p2kUUjnxfbRYRd78bDEeXAc3PK2LzyBEQqkV4= +github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240429192223-e696a8e439b5/go.mod h1:+4JWLclBOT+emyBh6NAZSEbqEwzHcWHpIbfsXmRASgY= +github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240429192223-e696a8e439b5 h1:6Cg0h+8Iyy/Nnefk5j0gdeVoMTNpUooAMjyV8sk6zoA= +github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240429192223-e696a8e439b5/go.mod h1:0oTx6Nkc+LdOXaZe3PRtV1cY+J5z5ig08alR8d+OPHs= +github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240424211859-3ff4c0fe2a1e h1:2LO6Rtmz2PVfH+ZXnMwvTwVeIz3PCy0fs3lQraqog14= +github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240424211859-3ff4c0fe2a1e/go.mod h1:PwsL8fC81cjnUnTfmyL/HOIyHnyaw/JA474Wfj2tl6A= +github.com/onflow/flow-ft/lib/go/templates v0.7.1-0.20240424211859-3ff4c0fe2a1e h1:jl7SYAui/gYRmBofrY//Ln8ixRJwvLzvwLstNfRKmWY= +github.com/onflow/flow-ft/lib/go/templates v0.7.1-0.20240424211859-3ff4c0fe2a1e/go.mod h1:uQ8XFqmMK2jxyBSVrmyuwdWjTEb+6zGjRYotfDJ5pAE= github.com/onflow/flow-go-sdk v1.0.0-M1/go.mod h1:TDW0MNuCs4SvqYRUzkbRnRmHQL1h4X8wURsCw9P9beo= github.com/onflow/flow-go-sdk v1.0.0-preview.25 h1:wL/+cK7oxSww31qSqTpt1Yfr26c8hJ8YHh9nIdq6PlI= github.com/onflow/flow-go-sdk v1.0.0-preview.25/go.mod h1:Px1fQdB7WFC0yhYsEM3rhKzuE+Zi8GpBjR4qVuDAwMA= -github.com/onflow/flow-nft/lib/go/contracts v1.2.0 h1:TFH7GCJKcGi0+x14SCvF7Gbnxp68gJOGNV8PSIAM2J0= -github.com/onflow/flow-nft/lib/go/contracts v1.2.0/go.mod h1:2gpbza+uzs1k7x31hkpBPlggIRkI53Suo0n2AyA2HcE= -github.com/onflow/flow-nft/lib/go/templates v1.2.0 h1:JSQyh9rg0RC+D1930BiRXN8lrtMs+ubVMK6aQPon6Yc= -github.com/onflow/flow-nft/lib/go/templates v1.2.0/go.mod h1:p+2hRvtjLUR3MW1NsoJe5Gqgr2eeH49QB6+s6ze00w0= +github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240429184308-40c3de711140 h1:oTj4RGgfuJSSBE1aDVrlh6avxKBMraucpNtRg0K+yhg= +github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240429184308-40c3de711140/go.mod h1:2gpbza+uzs1k7x31hkpBPlggIRkI53Suo0n2AyA2HcE= +github.com/onflow/flow-nft/lib/go/templates v0.0.0-20240429184308-40c3de711140 h1:7NwSIG4SEdm+96gr+Aaqx291jZ/Bqkxk/ghVnens9CU= +github.com/onflow/flow-nft/lib/go/templates v0.0.0-20240429184308-40c3de711140/go.mod h1:p+2hRvtjLUR3MW1NsoJe5Gqgr2eeH49QB6+s6ze00w0= github.com/onflow/flow/protobuf/go/flow v0.3.2-0.20231121210617-52ee94b830c2/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk= github.com/onflow/flow/protobuf/go/flow v0.4.1-0.20240412170550-911321113030 h1:I+aosSiJny88O4p3nPbCiUcp/UqN6AepvO6uj82bjH0= github.com/onflow/flow/protobuf/go/flow v0.4.1-0.20240412170550-911321113030/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk= diff --git a/integration/go.mod b/integration/go.mod index ef16d2e3469..14865650170 100644 --- a/integration/go.mod +++ b/integration/go.mod @@ -21,8 +21,8 @@ require ( github.com/libp2p/go-libp2p v0.32.2 github.com/onflow/cadence v1.0.0-preview.25 github.com/onflow/crypto v0.25.1 - github.com/onflow/flow-core-contracts/lib/go/contracts v1.0.1-0.20240507163519-1face7decbc1 - github.com/onflow/flow-core-contracts/lib/go/templates v1.0.1-0.20240507163519-1face7decbc1 + github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240429192223-e696a8e439b5 + github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240429192223-e696a8e439b5 github.com/onflow/flow-emulator v1.0.0-preview.21.0.20240501034320-e644fcba11e2 github.com/onflow/flow-go v0.34.0-crescendo-preview.10-staged-contracts-3.0.20240501031941-53ca114d9c37 github.com/onflow/flow-go-sdk v1.0.0-preview.25 @@ -242,10 +242,10 @@ require ( github.com/multiformats/go-varint v0.0.7 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/onflow/atree v0.7.0-rc.1 // indirect - github.com/onflow/flow-ft/lib/go/contracts v1.0.0 // indirect - github.com/onflow/flow-ft/lib/go/templates v1.0.0 // indirect - github.com/onflow/flow-nft/lib/go/contracts v1.2.0 // indirect - github.com/onflow/flow-nft/lib/go/templates v1.2.0 // indirect + github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240424211859-3ff4c0fe2a1e // indirect + github.com/onflow/flow-ft/lib/go/templates v0.7.1-0.20240424211859-3ff4c0fe2a1e // indirect + github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240429184308-40c3de711140 // indirect + github.com/onflow/flow-nft/lib/go/templates v0.0.0-20240429184308-40c3de711140 // indirect github.com/onflow/sdks v0.5.1-0.20230912225508-b35402f12bba // indirect github.com/onflow/wal v0.0.0-20240208022732-d756cd497d3b // indirect github.com/onsi/ginkgo/v2 v2.13.2 // indirect diff --git a/integration/go.sum b/integration/go.sum index e4c4ed5c2cc..51194079f68 100644 --- a/integration/go.sum +++ b/integration/go.sum @@ -2142,23 +2142,23 @@ github.com/onflow/cadence v1.0.0-preview.25/go.mod h1:fGhLBbuEmv5rh48qv0ZS0tUz53 github.com/onflow/crypto v0.25.0/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI= github.com/onflow/crypto v0.25.1 h1:0txy2PKPMM873JbpxQNbJmuOJtD56bfs48RQfm0ts5A= github.com/onflow/crypto v0.25.1/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI= -github.com/onflow/flow-core-contracts/lib/go/contracts v1.0.1-0.20240507163519-1face7decbc1 h1:Odgoma4opYOuGKUfKYd5Zus9/R6euE1A3tdlClwCUrs= -github.com/onflow/flow-core-contracts/lib/go/contracts v1.0.1-0.20240507163519-1face7decbc1/go.mod h1:ACen33wxzi3AsptCw/1rQ4McV5LumEhK0cC17RFG4o0= -github.com/onflow/flow-core-contracts/lib/go/templates v1.0.1-0.20240507163519-1face7decbc1 h1:xWrEpO1cLk3VHrReiHkniJ1fJ4+br1aPWKxMd0fH2dM= -github.com/onflow/flow-core-contracts/lib/go/templates v1.0.1-0.20240507163519-1face7decbc1/go.mod h1:NgbMOYnMh0GN48VsNKZuiwK7uyk38Wyo8jN9+C9QE30= +github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240429192223-e696a8e439b5 h1:by3a+8p2kUUjnxfbRYRd78bDEeXAc3PK2LzyBEQqkV4= +github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240429192223-e696a8e439b5/go.mod h1:+4JWLclBOT+emyBh6NAZSEbqEwzHcWHpIbfsXmRASgY= +github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240429192223-e696a8e439b5 h1:6Cg0h+8Iyy/Nnefk5j0gdeVoMTNpUooAMjyV8sk6zoA= +github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240429192223-e696a8e439b5/go.mod h1:0oTx6Nkc+LdOXaZe3PRtV1cY+J5z5ig08alR8d+OPHs= github.com/onflow/flow-emulator v1.0.0-preview.21.0.20240501034320-e644fcba11e2 h1:BMT/YaJMrj0F6DQ/zdxvrzR9OUvt8QeiORoCEjaCm5Q= github.com/onflow/flow-emulator v1.0.0-preview.21.0.20240501034320-e644fcba11e2/go.mod h1:6YYaVcM+47UrZUgd5Jgh7KMWEx1k2gGqW0iS1RPE9+I= -github.com/onflow/flow-ft/lib/go/contracts v1.0.0 h1:mToacZ5NWqtlWwk/7RgIl/jeKB/Sy/tIXdw90yKHcV0= -github.com/onflow/flow-ft/lib/go/contracts v1.0.0/go.mod h1:PwsL8fC81cjnUnTfmyL/HOIyHnyaw/JA474Wfj2tl6A= -github.com/onflow/flow-ft/lib/go/templates v1.0.0 h1:6cMS/lUJJ17HjKBfMO/eh0GGvnpElPgBXx7h5aoWJhs= -github.com/onflow/flow-ft/lib/go/templates v1.0.0/go.mod h1:uQ8XFqmMK2jxyBSVrmyuwdWjTEb+6zGjRYotfDJ5pAE= +github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240424211859-3ff4c0fe2a1e h1:2LO6Rtmz2PVfH+ZXnMwvTwVeIz3PCy0fs3lQraqog14= +github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240424211859-3ff4c0fe2a1e/go.mod h1:PwsL8fC81cjnUnTfmyL/HOIyHnyaw/JA474Wfj2tl6A= +github.com/onflow/flow-ft/lib/go/templates v0.7.1-0.20240424211859-3ff4c0fe2a1e h1:jl7SYAui/gYRmBofrY//Ln8ixRJwvLzvwLstNfRKmWY= +github.com/onflow/flow-ft/lib/go/templates v0.7.1-0.20240424211859-3ff4c0fe2a1e/go.mod h1:uQ8XFqmMK2jxyBSVrmyuwdWjTEb+6zGjRYotfDJ5pAE= github.com/onflow/flow-go-sdk v1.0.0-M1/go.mod h1:TDW0MNuCs4SvqYRUzkbRnRmHQL1h4X8wURsCw9P9beo= github.com/onflow/flow-go-sdk v1.0.0-preview.25 h1:wL/+cK7oxSww31qSqTpt1Yfr26c8hJ8YHh9nIdq6PlI= github.com/onflow/flow-go-sdk v1.0.0-preview.25/go.mod h1:Px1fQdB7WFC0yhYsEM3rhKzuE+Zi8GpBjR4qVuDAwMA= -github.com/onflow/flow-nft/lib/go/contracts v1.2.0 h1:TFH7GCJKcGi0+x14SCvF7Gbnxp68gJOGNV8PSIAM2J0= -github.com/onflow/flow-nft/lib/go/contracts v1.2.0/go.mod h1:2gpbza+uzs1k7x31hkpBPlggIRkI53Suo0n2AyA2HcE= -github.com/onflow/flow-nft/lib/go/templates v1.2.0 h1:JSQyh9rg0RC+D1930BiRXN8lrtMs+ubVMK6aQPon6Yc= -github.com/onflow/flow-nft/lib/go/templates v1.2.0/go.mod h1:p+2hRvtjLUR3MW1NsoJe5Gqgr2eeH49QB6+s6ze00w0= +github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240429184308-40c3de711140 h1:oTj4RGgfuJSSBE1aDVrlh6avxKBMraucpNtRg0K+yhg= +github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240429184308-40c3de711140/go.mod h1:2gpbza+uzs1k7x31hkpBPlggIRkI53Suo0n2AyA2HcE= +github.com/onflow/flow-nft/lib/go/templates v0.0.0-20240429184308-40c3de711140 h1:7NwSIG4SEdm+96gr+Aaqx291jZ/Bqkxk/ghVnens9CU= +github.com/onflow/flow-nft/lib/go/templates v0.0.0-20240429184308-40c3de711140/go.mod h1:p+2hRvtjLUR3MW1NsoJe5Gqgr2eeH49QB6+s6ze00w0= github.com/onflow/flow/protobuf/go/flow v0.3.2-0.20231121210617-52ee94b830c2/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk= github.com/onflow/flow/protobuf/go/flow v0.4.1-0.20240412170550-911321113030 h1:I+aosSiJny88O4p3nPbCiUcp/UqN6AepvO6uj82bjH0= github.com/onflow/flow/protobuf/go/flow v0.4.1-0.20240412170550-911321113030/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk= diff --git a/integration/tests/upgrades/protocol_version_upgrade_test.go b/integration/tests/upgrades/protocol_version_upgrade_test.go index bc4ecb499e0..303ee495919 100644 --- a/integration/tests/upgrades/protocol_version_upgrade_test.go +++ b/integration/tests/upgrades/protocol_version_upgrade_test.go @@ -16,6 +16,7 @@ import ( "github.com/onflow/flow-go/integration/utils" "github.com/onflow/flow-go/model/flow" "github.com/onflow/flow-go/state/protocol/protocol_state/kvstore" + "github.com/onflow/flow-go/utils/unittest" ) type ProtocolVersionUpgradeSuite struct { @@ -25,7 +26,7 @@ type ProtocolVersionUpgradeSuite struct { func TestProtocolVersionUpgrade(t *testing.T) { // See https://github.com/onflow/flow-go/pull/5840/files#r1589483631 // Must merge and pin https://github.com/onflow/flow-core-contracts/pull/419 to re-enable test - //unittest.SkipUnless(t, unittest.TEST_TODO, "skipped as it depends on VersionBeacon contract upgrade") + unittest.SkipUnless(t, unittest.TEST_TODO, "skipped as it depends on VersionBeacon contract upgrade") suite.Run(t, new(ProtocolVersionUpgradeSuite)) } diff --git a/integration/utils/templates/set-protocol-state-version.cdc b/integration/utils/templates/set-protocol-state-version.cdc index e69b5fc4812..1a6cca1854d 100644 --- a/integration/utils/templates/set-protocol-state-version.cdc +++ b/integration/utils/templates/set-protocol-state-version.cdc @@ -1,4 +1,4 @@ -import NodeVersionBeacon from "NodeVersionBeacon" +import NodeVersionBeacon from 0xNODEVERSIONBEACONADDRESS /// Transaction that allows NodeVersionAdmin to specify a new protocol state version. /// The new version will become active at view `activeView` if the service event @@ -22,7 +22,7 @@ transaction(newProtocolVersion: UInt64, activeViewDiff: UInt64) { execute { let block = getCurrentBlock() - self.adminRef.emitProtocolStateVersionUpgrade( + self.adminRef.setPendingProtocolStateVersionUpgrade( newProtocolVersion: newProtocolVersion, activeView: block.view + activeViewDiff ) From f497caf2eeccec18a738ad5dac3bf60dcc72faed Mon Sep 17 00:00:00 2001 From: Jordan Schalm Date: Wed, 8 May 2024 12:01:18 -0400 Subject: [PATCH 4/6] update IsServiceEvent godoc --- fvm/environment/event_emitter.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/fvm/environment/event_emitter.go b/fvm/environment/event_emitter.go index 46b68b05325..a5246b1da73 100644 --- a/fvm/environment/event_emitter.go +++ b/fvm/environment/event_emitter.go @@ -292,8 +292,6 @@ func (collection *EventCollection) TotalEventCounter() uint32 { // IsServiceEvent determines whether an emitted Cadence event is considered a service event for the given chain. // An event is a service event if it is defined in the `systemcontracts` package allow-list. -// All service events must be defined in system contracts. -// Service events may func IsServiceEvent(eventType flow.EventType, chain flow.ChainID) (bool, error) { // retrieve the service event information for this chain From cbc55e4fa518656803622b054f63fad12c8e72bb Mon Sep 17 00:00:00 2001 From: Jordan Schalm Date: Thu, 9 May 2024 14:37:29 -0400 Subject: [PATCH 5/6] Update fvm/environment/event_emitter.go Co-authored-by: Alexander Hentschel --- fvm/environment/event_emitter.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fvm/environment/event_emitter.go b/fvm/environment/event_emitter.go index a5246b1da73..52a7cf2576a 100644 --- a/fvm/environment/event_emitter.go +++ b/fvm/environment/event_emitter.go @@ -292,6 +292,9 @@ func (collection *EventCollection) TotalEventCounter() uint32 { // IsServiceEvent determines whether an emitted Cadence event is considered a service event for the given chain. // An event is a service event if it is defined in the `systemcontracts` package allow-list. +// Note that we have *removed* the prior constraint that service events can only be +// emitted in the system chunk. Now a system smart contract can emit service events +// as part of any transaction. func IsServiceEvent(eventType flow.EventType, chain flow.ChainID) (bool, error) { // retrieve the service event information for this chain From bef5cfa9132dba7cd39d820838175a468b07a5a9 Mon Sep 17 00:00:00 2001 From: Jordan Schalm Date: Thu, 9 May 2024 14:52:04 -0400 Subject: [PATCH 6/6] Update fvm/environment/event_emitter.go --- fvm/environment/event_emitter.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fvm/environment/event_emitter.go b/fvm/environment/event_emitter.go index 52a7cf2576a..c9ccc26ca6f 100644 --- a/fvm/environment/event_emitter.go +++ b/fvm/environment/event_emitter.go @@ -292,7 +292,7 @@ func (collection *EventCollection) TotalEventCounter() uint32 { // IsServiceEvent determines whether an emitted Cadence event is considered a service event for the given chain. // An event is a service event if it is defined in the `systemcontracts` package allow-list. -// Note that we have *removed* the prior constraint that service events can only be +// Note that we have *removed* the prior constraint that service events can only be // emitted in the system chunk. Now a system smart contract can emit service events // as part of any transaction. func IsServiceEvent(eventType flow.EventType, chain flow.ChainID) (bool, error) {