Skip to content

Commit ef46295

Browse files
authored
Merge pull request #7735 from onflow/bastian/update-cadence-v1.7.0-preview.1
Update to Cadence v1.7.0-preview.1
2 parents a34b385 + 97fdfcb commit ef46295

File tree

13 files changed

+34
-62
lines changed

13 files changed

+34
-62
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("86417e6e6e67954dfb8be38f001be052bfca92d8335b0e20943896ce39106b73")
60+
expectedStateCommitmentBytes, _ := hex.DecodeString("a278821691c3c112d263a3e4e13ff9c37c5b1ebb4d17510ed1c689afe6fa6241")
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("69312ac010d291189c83e9f1bb8145ca214a31d6b604850c87eb042a7cf20a15")
107+
expectedStateCommitmentBytes, _ := hex.DecodeString("f4e318531ad48464e15dcd0fac520faedd9b31c7de2e326c4c944d2c9d5e56f0")
108108
expectedStateCommitment, err := flow.ToStateCommitment(expectedStateCommitmentBytes)
109109
require.NoError(t, err)
110110

fvm/environment/facade_env.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -338,15 +338,6 @@ func (*facadeEnvironment) ResourceOwnerChanged(
338338
// NO-OP
339339
}
340340

341-
func (*facadeEnvironment) SetInterpreterSharedState(_ *interpreter.SharedState) {
342-
// NO-OP
343-
}
344-
345-
func (*facadeEnvironment) GetInterpreterSharedState() *interpreter.SharedState {
346-
// NO-OP
347-
return nil
348-
}
349-
350341
func (env *facadeEnvironment) RecoverProgram(program *ast.Program, location common.Location) ([]byte, error) {
351342
return RecoverProgram(
352343
env.chain.ChainID(),

fvm/environment/mock/environment.go

Lines changed: 3 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

fvm/environment/program_logger.go

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,9 @@ func (logger *ProgramLogger) Logs() []string {
138138

139139
func (logger *ProgramLogger) RecordTrace(
140140
operation string,
141-
location common.Location,
142141
duration time.Duration,
143142
attrs []attribute.KeyValue,
144143
) {
145-
if location != nil {
146-
attrs = append(attrs, attribute.String("location", location.String()))
147-
}
148-
149144
end := time.Now()
150145

151146
span := logger.tracer.StartChildSpan(
@@ -160,7 +155,7 @@ func (logger *ProgramLogger) ProgramParsed(
160155
location common.Location,
161156
duration time.Duration,
162157
) {
163-
logger.RecordTrace("parseProgram", location, duration, nil)
158+
logger.RecordTrace("parseProgram", duration, nil)
164159

165160
// These checks prevent re-reporting durations, the metrics collection is
166161
// a bit counter-intuitive:
@@ -182,7 +177,7 @@ func (logger *ProgramLogger) ProgramChecked(
182177
location common.Location,
183178
duration time.Duration,
184179
) {
185-
logger.RecordTrace("checkProgram", location, duration, nil)
180+
logger.RecordTrace("checkProgram", duration, nil)
186181

187182
// see the comment for ProgramParsed
188183
if location == nil {
@@ -198,7 +193,7 @@ func (logger *ProgramLogger) ProgramInterpreted(
198193
location common.Location,
199194
duration time.Duration,
200195
) {
201-
logger.RecordTrace("interpretProgram", location, duration, nil)
196+
logger.RecordTrace("interpretProgram", duration, nil)
202197

203198
// see the comment for ProgramInterpreted
204199
if location == nil {
@@ -211,10 +206,10 @@ func (logger *ProgramLogger) ProgramInterpreted(
211206

212207
// ValueEncoded accumulates time spend on runtime value encoding
213208
func (logger *ProgramLogger) ValueEncoded(duration time.Duration) {
214-
logger.RecordTrace("encodeValue", nil, duration, nil)
209+
logger.RecordTrace("encodeValue", duration, nil)
215210
}
216211

217212
// ValueDecoded accumulates time spend on runtime value decoding
218213
func (logger *ProgramLogger) ValueDecoded(duration time.Duration) {
219-
logger.RecordTrace("decodeValue", nil, duration, nil)
214+
logger.RecordTrace("decodeValue", duration, nil)
220215
}

fvm/meter/memory_meter.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ var (
155155
common.MemoryKindMembers: 276,
156156
common.MemoryKindTypeAnnotation: 25,
157157
common.MemoryKindDictionaryEntry: 33,
158+
common.MemoryKindSwitchCase: 17,
158159

159160
common.MemoryKindFunctionDeclaration: 49,
160161
common.MemoryKindCompositeDeclaration: 65,
@@ -252,6 +253,16 @@ var (
252253
common.MemoryKindCadenceInclusiveRangeValue: 81,
253254
common.MemoryKindCadenceInclusiveRangeType: 33,
254255
common.MemoryKindInclusiveRangeSemaType: 17,
256+
257+
common.MemoryKindContractVariable: 17,
258+
common.MemoryKindGoSliceLength: 17,
259+
260+
common.MemoryKindCompiler: 17,
261+
common.MemoryKindCompilerGlobal: 17,
262+
common.MemoryKindCompilerConstant: 17,
263+
264+
common.MemoryKindBoundFunctionVMValue: 17,
265+
common.MemoryKindImplicitReferenceVMValue: 17,
255266
}
256267
)
257268

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ require (
4848
github.com/multiformats/go-multiaddr-dns v0.4.1
4949
github.com/multiformats/go-multihash v0.2.3
5050
github.com/onflow/atree v0.10.0
51-
github.com/onflow/cadence v1.6.5
51+
github.com/onflow/cadence v1.7.0-preview.1
5252
github.com/onflow/crypto v0.25.3
5353
github.com/onflow/flow v0.3.4
5454
github.com/onflow/flow-core-contracts/lib/go/contracts v1.7.3

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -943,8 +943,8 @@ github.com/onflow/atree v0.10.0 h1:LFYlRgb0fjs8vezBW/N/tzi+ijLMssjHwIwoV4RwYaA=
943943
github.com/onflow/atree v0.10.0/go.mod h1:aqnnE8Os77JiBIeC7UcbeM7N1V3Ys5XWH0CykeMpym0=
944944
github.com/onflow/boxo v0.0.0-20240201202436-f2477b92f483 h1:LpiQhTAfM9CAmNVEs0n//cBBgCg+vJSiIxTHYUklZ84=
945945
github.com/onflow/boxo v0.0.0-20240201202436-f2477b92f483/go.mod h1:pIZgTWdm3k3pLF9Uq6MB8JEcW07UDwNJjlXW1HELW80=
946-
github.com/onflow/cadence v1.6.5 h1:UgaT1S0Km2jiEKfFH8NUhaIJjomndfU30PebLTZ3iLc=
947-
github.com/onflow/cadence v1.6.5/go.mod h1:MBHOSmj81EtNEGjvYK3UEaFMMrN6jo5wt9U7jvDVLUw=
946+
github.com/onflow/cadence v1.7.0-preview.1 h1:FqCm/W8dZvQmlV8uQBQY6dS4H5PF8h+KlMCS264vwa0=
947+
github.com/onflow/cadence v1.7.0-preview.1/go.mod h1:DD8dPX6B+5XZ/PocGNmnKYraF0df0np290hIYfEk8Yc=
948948
github.com/onflow/crypto v0.25.3 h1:XQ3HtLsw8h1+pBN+NQ1JYM9mS2mVXTyg55OldaAIF7U=
949949
github.com/onflow/crypto v0.25.3/go.mod h1:+1igaXiK6Tjm9wQOBD1EGwW7bYWMUGKtwKJ/2QL/OWs=
950950
github.com/onflow/flow v0.3.4 h1:FXUWVdYB90f/rjNcY0Owo30gL790tiYff9Pb/sycXYE=

insecure/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ require (
214214
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
215215
github.com/olekukonko/tablewriter v0.0.5 // indirect
216216
github.com/onflow/atree v0.10.0 // indirect
217-
github.com/onflow/cadence v1.6.5 // indirect
217+
github.com/onflow/cadence v1.7.0-preview.1 // indirect
218218
github.com/onflow/flow-core-contracts/lib/go/contracts v1.7.3 // indirect
219219
github.com/onflow/flow-core-contracts/lib/go/templates v1.7.1 // indirect
220220
github.com/onflow/flow-evm-bridge v0.1.0 // indirect

insecure/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -893,8 +893,8 @@ github.com/onflow/atree v0.10.0 h1:LFYlRgb0fjs8vezBW/N/tzi+ijLMssjHwIwoV4RwYaA=
893893
github.com/onflow/atree v0.10.0/go.mod h1:aqnnE8Os77JiBIeC7UcbeM7N1V3Ys5XWH0CykeMpym0=
894894
github.com/onflow/boxo v0.0.0-20240201202436-f2477b92f483 h1:LpiQhTAfM9CAmNVEs0n//cBBgCg+vJSiIxTHYUklZ84=
895895
github.com/onflow/boxo v0.0.0-20240201202436-f2477b92f483/go.mod h1:pIZgTWdm3k3pLF9Uq6MB8JEcW07UDwNJjlXW1HELW80=
896-
github.com/onflow/cadence v1.6.5 h1:UgaT1S0Km2jiEKfFH8NUhaIJjomndfU30PebLTZ3iLc=
897-
github.com/onflow/cadence v1.6.5/go.mod h1:MBHOSmj81EtNEGjvYK3UEaFMMrN6jo5wt9U7jvDVLUw=
896+
github.com/onflow/cadence v1.7.0-preview.1 h1:FqCm/W8dZvQmlV8uQBQY6dS4H5PF8h+KlMCS264vwa0=
897+
github.com/onflow/cadence v1.7.0-preview.1/go.mod h1:DD8dPX6B+5XZ/PocGNmnKYraF0df0np290hIYfEk8Yc=
898898
github.com/onflow/crypto v0.25.3 h1:XQ3HtLsw8h1+pBN+NQ1JYM9mS2mVXTyg55OldaAIF7U=
899899
github.com/onflow/crypto v0.25.3/go.mod h1:+1igaXiK6Tjm9wQOBD1EGwW7bYWMUGKtwKJ/2QL/OWs=
900900
github.com/onflow/flow-core-contracts/lib/go/contracts v1.7.3 h1:g/h3xnpf39jqzsxxJjWoFHazEWsaZ7Rfzg+uGt9fwPo=

integration/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ require (
2121
github.com/ipfs/go-ds-badger2 v0.1.4
2222
github.com/ipfs/go-ds-pebble v0.5.0
2323
github.com/libp2p/go-libp2p v0.38.2
24-
github.com/onflow/cadence v1.6.5
24+
github.com/onflow/cadence v1.7.0-preview.1
2525
github.com/onflow/crypto v0.25.3
2626
github.com/onflow/flow-core-contracts/lib/go/contracts v1.7.3
2727
github.com/onflow/flow-core-contracts/lib/go/templates v1.7.1

0 commit comments

Comments
 (0)