From fc7df6cf4f962fa6429e59954a9fc8d728cd7bc0 Mon Sep 17 00:00:00 2001 From: SupunS Date: Tue, 8 Oct 2024 20:22:32 +0000 Subject: [PATCH 01/16] v1.0.1 --- npm-packages/cadence-parser/package.json | 2 +- version.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-packages/cadence-parser/package.json b/npm-packages/cadence-parser/package.json index 7cbff25e53..0a3cf1e26f 100644 --- a/npm-packages/cadence-parser/package.json +++ b/npm-packages/cadence-parser/package.json @@ -1,6 +1,6 @@ { "name": "@onflow/cadence-parser", - "version": "1.0.0-preview.52", + "version": "1.0.1-preview.52", "description": "The Cadence parser", "homepage": "https://github.com/onflow/cadence", "repository": { diff --git a/version.go b/version.go index ec1468a4d3..61904d635a 100644 --- a/version.go +++ b/version.go @@ -21,4 +21,4 @@ package cadence -const Version = "v1.0.0" +const Version = "v1.0.1" From 487e31ac299c2d1adcee282f8018db42dd42c1e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Wed, 9 Oct 2024 14:56:27 -0700 Subject: [PATCH 02/16] prevent predeclared members to get confused using user-defined types --- runtime/ast/expression.go | 2 +- runtime/runtime_test.go | 67 +++++++++++++++ runtime/sema/check_composite_declaration.go | 94 ++++++++++++++++----- runtime/tests/checker/attachments_test.go | 23 ++++- runtime/tests/checker/composite_test.go | 52 ++++++++++++ runtime/tests/checker/contract_test.go | 30 +++++++ runtime/tests/checker/nesting_test.go | 3 +- 7 files changed, 246 insertions(+), 25 deletions(-) diff --git a/runtime/ast/expression.go b/runtime/ast/expression.go index 0142b92b20..deed882354 100644 --- a/runtime/ast/expression.go +++ b/runtime/ast/expression.go @@ -1416,7 +1416,7 @@ func FunctionDocument( } // NOTE: not all functions have a parameter list, - // e.g. the `destroy` special function + // e.g. the `init` (initializer, special function) if parameterList != nil { signatureDoc = append( diff --git a/runtime/runtime_test.go b/runtime/runtime_test.go index 7005274fed..2b57648779 100644 --- a/runtime/runtime_test.go +++ b/runtime/runtime_test.go @@ -11480,3 +11480,70 @@ func TestRuntimeStorageEnumAsDictionaryKey(t *testing.T) { loggedMessages, ) } + +func TestRuntimeBuiltInFunctionConfusion(t *testing.T) { + + t.Parallel() + + const contract = ` + access(all) contract Foo { + access(all) resource getType {} + + init() { + Foo.getType() + } + } + ` + + runtime := NewTestInterpreterRuntime() + + address := common.MustBytesToAddress([]byte{0x1}) + + accountCodes := map[common.AddressLocation][]byte{} + var events []cadence.Event + var loggedMessages []string + + runtimeInterface := &TestRuntimeInterface{ + Storage: NewTestLedger(nil, nil), + OnGetSigningAccounts: func() ([]common.Address, error) { + return []common.Address{address}, nil + }, + OnResolveLocation: NewSingleIdentifierLocationResolver(t), + OnUpdateAccountContractCode: func(location common.AddressLocation, code []byte) error { + accountCodes[location] = code + return nil + }, + OnGetAccountContractCode: func(location common.AddressLocation) (code []byte, err error) { + code = accountCodes[location] + return code, nil + }, + OnEmitEvent: func(event cadence.Event) error { + events = append(events, event) + return nil + }, + OnProgramLog: func(message string) { + loggedMessages = append(loggedMessages, message) + }, + } + + nextTransactionLocation := NewTransactionLocationGenerator() + + // Deploy contract + + err := runtime.ExecuteTransaction( + Script{ + Source: DeploymentTransaction( + "Foo", + []byte(contract), + ), + }, + Context{ + Interface: runtimeInterface, + Location: nextTransactionLocation(), + }, + ) + RequireError(t, err) + + var redeclarationError *sema.RedeclarationError + require.ErrorAs(t, err, &redeclarationError) +} diff --git a/runtime/sema/check_composite_declaration.go b/runtime/sema/check_composite_declaration.go index 5bc46ecd5e..84030e0224 100644 --- a/runtime/sema/check_composite_declaration.go +++ b/runtime/sema/check_composite_declaration.go @@ -1688,39 +1688,84 @@ func (checker *Checker) defaultMembersAndOrigins( } predeclaredMembers := checker.predeclaredMembers(containerType) - invalidIdentifiers := make(map[string]bool, len(predeclaredMembers)) - + predeclaredMemberNames := make(map[string]struct{}, len(predeclaredMembers)) for _, predeclaredMember := range predeclaredMembers { name := predeclaredMember.Identifier.Identifier - members.Set(name, predeclaredMember) - invalidIdentifiers[name] = true + predeclaredMemberNames[name] = struct{}{} + } - if predeclaredMember.DeclarationKind == common.DeclarationKindField { - fieldNames = append(fieldNames, name) + var nestedTypes *StringTypeOrderedMap + if containerType, ok := containerType.(ContainerType); ok { + nestedTypes = containerType.GetNestedTypes() + } + + checkRedeclaration := func( + identifier ast.Identifier, + declarationKind common.DeclarationKind, + isPredeclared bool, + ) bool { + name := identifier.Identifier + + if !isPredeclared { + if _, ok := predeclaredMemberNames[name]; ok { + checker.report( + &InvalidDeclarationError{ + Identifier: identifier.Identifier, + Kind: declarationKind, + Range: ast.NewRangeFromPositioned(checker.memoryGauge, identifier), + }, + ) + return false + } + } + + if nestedTypes != nil { + if _, ok := nestedTypes.Get(name); ok { + // TODO: provide previous position + checker.report( + &RedeclarationError{ + Name: name, + Kind: declarationKind, + Pos: identifier.Pos, + }, + ) + + return false + } } + + return true } - checkInvalidIdentifier := func(declaration ast.Declaration) bool { - identifier := declaration.DeclarationIdentifier() - if invalidIdentifiers == nil || !invalidIdentifiers[identifier.Identifier] { - return true + // declare all predeclared members (built-in functions and fields) + for _, predeclaredMember := range predeclaredMembers { + identifier := predeclaredMember.Identifier + name := identifier.Identifier + declarationKind := predeclaredMember.DeclarationKind + + if !checkRedeclaration( + identifier, + declarationKind, + true, + ) { + continue } - checker.report( - &InvalidDeclarationError{ - Identifier: identifier.Identifier, - Kind: declaration.DeclarationKind(), - Range: ast.NewRangeFromPositioned(checker.memoryGauge, identifier), - }, - ) + members.Set(name, predeclaredMember) - return false + if declarationKind == common.DeclarationKindField { + fieldNames = append(fieldNames, name) + } } // declare a member for each field for _, field := range fields { - if !checkInvalidIdentifier(field) { + if !checkRedeclaration( + field.Identifier, + field.DeclarationKind(), + false, + ) { continue } @@ -1792,7 +1837,12 @@ func (checker *Checker) defaultMembersAndOrigins( // declare a member for each function for _, function := range functions { - if !checkInvalidIdentifier(function) { + + if !checkRedeclaration( + function.Identifier, + function.DeclarationKind(), + false, + ) { continue } @@ -2406,7 +2456,7 @@ func (checker *Checker) declareBaseValue(fnAccess Access, baseType Type, attachm } // checkNestedIdentifiers checks that nested identifiers, i.e. fields, functions, -// and nested interfaces and composites, are unique and aren't named `init` or `destroy` +// and nested interfaces and composites, are unique and aren't named `init` func (checker *Checker) checkNestedIdentifiers(members *ast.Members) { positions := map[string]ast.Position{} @@ -2430,7 +2480,7 @@ func (checker *Checker) checkNestedIdentifiers(members *ast.Members) { } // checkNestedIdentifier checks that the nested identifier is unique -// and isn't named `init` or `destroy` +// and isn't named `init` func (checker *Checker) checkNestedIdentifier( identifier ast.Identifier, kind common.DeclarationKind, diff --git a/runtime/tests/checker/attachments_test.go b/runtime/tests/checker/attachments_test.go index 766e075e1d..ac8f324f01 100644 --- a/runtime/tests/checker/attachments_test.go +++ b/runtime/tests/checker/attachments_test.go @@ -4757,7 +4757,7 @@ func TestCheckAttachmentForEachAttachment(t *testing.T) { assert.IsType(t, &sema.NotDeclaredMemberError{}, errs[0]) }) - t.Run("cannot redeclare forEachAttachment", func(t *testing.T) { + t.Run("cannot redeclare forEachAttachment as function", func(t *testing.T) { t.Parallel() @@ -4773,6 +4773,27 @@ func TestCheckAttachmentForEachAttachment(t *testing.T) { assert.IsType(t, &sema.InvalidDeclarationError{}, errs[0]) }) + t.Run("cannot redeclare forEachAttachment as field", func(t *testing.T) { + + t.Parallel() + + _, err := ParseAndCheck(t, + ` + access(all) struct S { + let forEachAttachment: Int + + init() { + self.forEachAttachment = 1 + } + } + `, + ) + + errs := RequireCheckerErrors(t, err, 2) + assert.IsType(t, &sema.InvalidDeclarationError{}, errs[0]) + assert.IsType(t, &sema.TypeMismatchError{}, errs[1]) + }) + t.Run("downcasting reference with entitlements", func(t *testing.T) { t.Parallel() diff --git a/runtime/tests/checker/composite_test.go b/runtime/tests/checker/composite_test.go index fe4d0c5e5a..98f458db9d 100644 --- a/runtime/tests/checker/composite_test.go +++ b/runtime/tests/checker/composite_test.go @@ -2298,3 +2298,55 @@ func TestCheckKeywordsAsFieldNames(t *testing.T) { }) } } + +func TestCheckInvalidFunctionNestedTypeClash(t *testing.T) { + + t.Parallel() + interfacePossibilities := []bool{true, false} + + for _, kind := range common.CompositeKindsWithFieldsAndFunctions { + for _, isInterface := range interfacePossibilities { + + interfaceKeyword := "" + if isInterface { + interfaceKeyword = "interface" + } + + var baseType string + + switch kind { + case common.CompositeKindContract: + // Cannot nest contracts + continue + + case common.CompositeKindAttachment: + if isInterface { + continue + } + baseType = "for AnyStruct" + } + + testName := fmt.Sprintf("%s_%s", kind.Keyword(), interfaceKeyword) + + t.Run(testName, func(t *testing.T) { + + _, err := ParseAndCheck(t, + fmt.Sprintf( + ` + contract C { + %s %s getType %s {} + } + `, + kind.Keyword(), + interfaceKeyword, + baseType, + ), + ) + + errs := RequireCheckerErrors(t, err, 1) + + assert.IsType(t, &sema.RedeclarationError{}, errs[0]) + }) + } + } +} diff --git a/runtime/tests/checker/contract_test.go b/runtime/tests/checker/contract_test.go index 0a2edbcb0d..a3b055ca27 100644 --- a/runtime/tests/checker/contract_test.go +++ b/runtime/tests/checker/contract_test.go @@ -94,6 +94,36 @@ func TestCheckInvalidContractInterfaceAccountFunction(t *testing.T) { assert.IsType(t, &sema.InvalidDeclarationError{}, errs[0]) } +func TestCheckInvalidContractAccountType(t *testing.T) { + + t.Parallel() + + _, err := ParseAndCheck(t, ` + contract Test { + struct account {} + } + `) + + errs := RequireCheckerErrors(t, err, 1) + + assert.IsType(t, &sema.RedeclarationError{}, errs[0]) +} + +func TestCheckInvalidContractInterfaceAccountType(t *testing.T) { + + t.Parallel() + + _, err := ParseAndCheck(t, ` + contract interface Test { + struct interface account {} + } + `) + + errs := RequireCheckerErrors(t, err, 1) + + assert.IsType(t, &sema.RedeclarationError{}, errs[0]) +} + func TestCheckContractAccountFieldUse(t *testing.T) { t.Parallel() diff --git a/runtime/tests/checker/nesting_test.go b/runtime/tests/checker/nesting_test.go index fda0d70f50..6e09c18f57 100644 --- a/runtime/tests/checker/nesting_test.go +++ b/runtime/tests/checker/nesting_test.go @@ -258,9 +258,10 @@ func TestCheckInvalidCompositeDeclarationNestedDuplicateNames(t *testing.T) { } `) - errs := RequireCheckerErrors(t, err, 1) + errs := RequireCheckerErrors(t, err, 2) assert.IsType(t, &sema.RedeclarationError{}, errs[0]) + assert.IsType(t, &sema.RedeclarationError{}, errs[1]) } func TestCheckCompositeDeclarationNestedConstructorAndType(t *testing.T) { From 5f28ddaa6555cb0c7de0e053d6f71838903d0329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Wed, 9 Oct 2024 22:30:08 -0700 Subject: [PATCH 03/16] forbid attachment conformances --- runtime/sema/check_composite_declaration.go | 26 +- runtime/sema/errors.go | 17 + runtime/tests/checker/attachments_test.go | 328 +------------------- runtime/tests/checker/entitlements_test.go | 110 ------- 4 files changed, 56 insertions(+), 425 deletions(-) diff --git a/runtime/sema/check_composite_declaration.go b/runtime/sema/check_composite_declaration.go index 84030e0224..cb2fac91bd 100644 --- a/runtime/sema/check_composite_declaration.go +++ b/runtime/sema/check_composite_declaration.go @@ -681,9 +681,31 @@ func (checker *Checker) declareCompositeType(declaration ast.CompositeLikeDeclar // Resolve conformances - if declaration.Kind() == common.CompositeKindEnum { + switch declaration.Kind() { + case common.CompositeKindEnum: compositeType.EnumRawType = checker.enumRawType(declaration.(*ast.CompositeDeclaration)) - } else { + + case common.CompositeKindAttachment: + // Attachments may not conform to interfaces + + conformanceList := declaration.ConformanceList() + conformanceCount := len(conformanceList) + if conformanceCount > 0 { + firstConformance := conformanceList[0] + lastConformance := conformanceList[conformanceCount-1] + + checker.report( + &InvalidAttachmentConformancesError{ + Range: ast.NewRange( + checker.memoryGauge, + firstConformance.StartPosition(), + lastConformance.EndPosition(checker.memoryGauge), + ), + }, + ) + } + + default: compositeType.ExplicitInterfaceConformances = checker.explicitInterfaceConformances(declaration, compositeType) } diff --git a/runtime/sema/errors.go b/runtime/sema/errors.go index 64c693802a..66efa2b57d 100644 --- a/runtime/sema/errors.go +++ b/runtime/sema/errors.go @@ -1440,6 +1440,23 @@ func (e *InvalidEnumConformancesError) Error() string { return "enums cannot conform to interfaces" } +// InvalidAttachmentConformancesError + +type InvalidAttachmentConformancesError struct { + ast.Range +} + +var _ SemanticError = &InvalidAttachmentConformancesError{} +var _ errors.UserError = &InvalidAttachmentConformancesError{} + +func (*InvalidAttachmentConformancesError) isSemanticError() {} + +func (*InvalidAttachmentConformancesError) IsUserError() {} + +func (e *InvalidAttachmentConformancesError) Error() string { + return "attachments cannot conform to interfaces" +} + // ConformanceError // TODO: report each missing member and mismatch as note diff --git a/runtime/tests/checker/attachments_test.go b/runtime/tests/checker/attachments_test.go index ac8f324f01..f6a3c75ae3 100644 --- a/runtime/tests/checker/attachments_test.go +++ b/runtime/tests/checker/attachments_test.go @@ -619,304 +619,42 @@ func TestCheckAttachmentWithMembers(t *testing.T) { }) } -func TestCheckAttachmentConformance(t *testing.T) { +func TestCheckInvalidAttachmentConformance(t *testing.T) { t.Parallel() - t.Run("basic", func(t *testing.T) { - - t.Parallel() - - _, err := ParseAndCheck(t, - ` - resource R {} - resource interface I { - } - attachment Test for R: I { - }`, - ) - - require.NoError(t, err) - }) - - t.Run("field", func(t *testing.T) { - - t.Parallel() - - _, err := ParseAndCheck(t, - ` - resource R {} - resource interface I { - let x: Int - } - attachment Test for R: I { - let x: Int - init(x: Int) { - self.x = x - } - }`, - ) - - require.NoError(t, err) - }) - - t.Run("method", func(t *testing.T) { - - t.Parallel() - - _, err := ParseAndCheck(t, - ` - resource R {} - resource interface I { - fun x(): Int - } - attachment Test for R: I { - fun x(): Int { return 0 } - }`, - ) - - require.NoError(t, err) - }) - - t.Run("field missing", func(t *testing.T) { - - t.Parallel() - - _, err := ParseAndCheck(t, - ` - resource R {} - resource interface I { - let x: Int - } - attachment Test for R: I { - }`, - ) - - errs := RequireCheckerErrors(t, err, 1) - - assert.IsType(t, &sema.ConformanceError{}, errs[0]) - }) - - t.Run("field type", func(t *testing.T) { - - t.Parallel() - - _, err := ParseAndCheck(t, - ` - resource R {} - resource interface I { - let x: Int - } - attachment Test for R: I { - let x: AnyStruct - init(x: AnyStruct) { - self.x = x - } - }`, - ) - - errs := RequireCheckerErrors(t, err, 1) - - assert.IsType(t, &sema.ConformanceError{}, errs[0]) - }) - - t.Run("method missing", func(t *testing.T) { - - t.Parallel() - - _, err := ParseAndCheck(t, - ` - resource R {} - resource interface I { - fun x(): Int - } - attachment Test for R: I { - }`, - ) - - errs := RequireCheckerErrors(t, err, 1) - - assert.IsType(t, &sema.ConformanceError{}, errs[0]) - }) - - t.Run("method type", func(t *testing.T) { + t.Run("struct", func(t *testing.T) { t.Parallel() - _, err := ParseAndCheck(t, - ` - resource R {} - resource interface I { - fun x(): Int - } - attachment Test for R: I { - fun x(): AnyStruct { return "" } - }`, - ) - - errs := RequireCheckerErrors(t, err, 1) - - assert.IsType(t, &sema.ConformanceError{}, errs[0]) - }) - - t.Run("method missing, exists in base type", func(t *testing.T) { + _, err := ParseAndCheck(t, ` + struct S {} - t.Parallel() + struct interface SI {} - _, err := ParseAndCheck(t, - ` - resource R { - fun x(): Int { return 3 } - } - resource interface I { - fun x(): Int - } - attachment Test for R: I { - }`, - ) + attachment Test for S: SI {} + `) errs := RequireCheckerErrors(t, err, 1) - assert.IsType(t, &sema.ConformanceError{}, errs[0]) + assert.IsType(t, &sema.InvalidAttachmentConformancesError{}, errs[0]) }) - t.Run("kind mismatch resource", func(t *testing.T) { + t.Run("resource", func(t *testing.T) { t.Parallel() - _, err := ParseAndCheck(t, - ` + _, err := ParseAndCheck(t, ` resource R {} - struct interface I {} - attachment Test for R: I {}`, - ) - - errs := RequireCheckerErrors(t, err, 1) - - assert.IsType(t, &sema.CompositeKindMismatchError{}, errs[0]) - }) - - t.Run("kind mismatch struct", func(t *testing.T) { - - t.Parallel() - - _, err := ParseAndCheck(t, - ` - struct R {} - resource interface I {} - attachment Test for R: I {}`, - ) - - errs := RequireCheckerErrors(t, err, 1) - - assert.IsType(t, &sema.CompositeKindMismatchError{}, errs[0]) - }) - - t.Run("conforms to base", func(t *testing.T) { - - t.Parallel() - - _, err := ParseAndCheck(t, - ` - resource interface I {} - attachment A for I: I {}`, - ) - - require.NoError(t, err) - }) - - t.Run("AnyResource base, resource conformance", func(t *testing.T) { - - t.Parallel() - _, err := ParseAndCheck(t, - ` - resource interface I {} - attachment A for AnyResource: I {}`, - ) + resource interface RI {} - require.NoError(t, err) - }) - - t.Run("AnyStruct base, struct conformance", func(t *testing.T) { - - t.Parallel() - - _, err := ParseAndCheck(t, - ` - struct interface I {} - attachment A for AnyStruct: I {}`, - ) - - require.NoError(t, err) - }) - - t.Run("AnyStruct base, resource conformance", func(t *testing.T) { - - t.Parallel() - - _, err := ParseAndCheck(t, - ` - resource interface I {} - attachment A for AnyStruct: I {}`, - ) - - errs := RequireCheckerErrors(t, err, 1) - - assert.IsType(t, &sema.CompositeKindMismatchError{}, errs[0]) - }) - - t.Run("AnyResource base, struct conformance", func(t *testing.T) { - - t.Parallel() - - _, err := ParseAndCheck(t, - ` - struct interface I {} - attachment A for AnyResource: I {}`, - ) + attachment Test for R: RI {} + `) errs := RequireCheckerErrors(t, err, 1) - assert.IsType(t, &sema.CompositeKindMismatchError{}, errs[0]) - }) - - t.Run("cross-contract concrete base", func(t *testing.T) { - - t.Parallel() - - _, err := ParseAndCheck(t, - ` - contract C0 { - resource interface R {} - } - contract C1 { - resource R {} - attachment A for R: C0.R {} - } - `, - ) - - require.NoError(t, err) - }) - - t.Run("cross-contract interface base", func(t *testing.T) { - - t.Parallel() - - _, err := ParseAndCheck(t, - ` - contract C0 { - resource R {} - } - contract C1 { - resource interface R {} - attachment A for C0.R: R {} - } - `, - ) - - require.NoError(t, err) + assert.IsType(t, &sema.InvalidAttachmentConformancesError{}, errs[0]) }) } @@ -1295,42 +1033,6 @@ func TestCheckAttachmentSelfTyping(t *testing.T) { require.NoError(t, err) }) - t.Run("return self struct interface", func(t *testing.T) { - - t.Parallel() - - _, err := ParseAndCheck(t, - ` - struct R {} - struct interface I {} - attachment Test for R: I { - fun foo(): &{I} { - return self - } - }`, - ) - - require.NoError(t, err) - }) - - t.Run("return self resource interface", func(t *testing.T) { - - t.Parallel() - - _, err := ParseAndCheck(t, - ` - resource R {} - resource interface I {} - attachment Test for R: I { - fun foo(): &{I} { - return self - } - }`, - ) - - require.NoError(t, err) - }) - t.Run("self access restricted", func(t *testing.T) { t.Parallel() @@ -3517,7 +3219,7 @@ func TestCheckAttachmentAccessAttachment(t *testing.T) { fmt.Sprintf(` resource R {} resource interface I {} - attachment A for AnyResource: I {} + attachment A for AnyResource {} access(all) fun foo(r: %sR) { r[I] %s diff --git a/runtime/tests/checker/entitlements_test.go b/runtime/tests/checker/entitlements_test.go index fb2a5f18dd..085d10370f 100644 --- a/runtime/tests/checker/entitlements_test.go +++ b/runtime/tests/checker/entitlements_test.go @@ -3031,116 +3031,6 @@ func TestCheckEntitlementInheritance(t *testing.T) { assert.NoError(t, err) }) - - t.Run("attachment inherited default entitled function entitlements on base", func(t *testing.T) { - t.Parallel() - - _, err := ParseAndCheck(t, ` - entitlement E - entitlement F - struct interface I { - access(E) fun foo(): auth(F) &Int { - return &1 as auth(F) &Int - } - } - struct interface I2: I {} - struct S { - access(E) fun foo() {} - } - access(all) attachment A for S: I2 {} - fun test() { - let s = attach A() to S() - let ref = &s as auth(E) &S - let attachmentRef: auth(E) &A = s[A]! - let i: auth(F) &Int = attachmentRef.foo() - } - `) - - assert.NoError(t, err) - }) - - t.Run("attachment inherited default mapped function entitlements on base", func(t *testing.T) { - t.Parallel() - - _, err := ParseAndCheck(t, ` - entitlement E - entitlement F - entitlement mapping M { - E -> F - } - struct interface I { - access(mapping M) fun foo(): auth(mapping M) &Int { - return &1 as auth(mapping M) &Int - } - } - struct interface I2: I {} - struct S { - access(E) fun foo() {} - } - access(all) attachment A for S: I2 {} - fun test() { - let s = attach A() to S() - let ref = &s as auth(E) &S - let attachmentRef: auth(E) &A = s[A]! - let i: auth(F) &Int = attachmentRef.foo() - } - `) - - assert.NoError(t, err) - }) - - t.Run("attachment inherited default mapped function entitlements not on base", func(t *testing.T) { - t.Parallel() - - _, err := ParseAndCheck(t, ` - entitlement E - entitlement F - entitlement mapping M { - E -> F - } - struct interface I { - access(mapping M) fun foo(): auth(mapping M) &Int { - return &1 as auth(mapping M) &Int - } - } - struct interface I2: I {} - struct S {} - access(all) attachment A for S: I2 {} - fun test() { - let s = attach A() to S() - let ref = &s as auth(E) &S - let i: auth(F) &Int = s[A]!.foo() - } - `) - - errs := RequireCheckerErrors(t, err, 1) - require.IsType(t, &sema.InvalidAttachmentEntitlementError{}, errs[0]) - }) - - t.Run("attachment inherited default entitled function entitlements not on base", func(t *testing.T) { - t.Parallel() - - _, err := ParseAndCheck(t, ` - entitlement E - entitlement F - struct interface I { - access(E) fun foo(): auth(F) &Int { - return &1 as auth(F) &Int - } - } - struct interface I2: I {} - struct S {} - access(all) attachment A for S: I2 {} - fun test() { - let s = attach A() to S() - let ref = &s as auth(E) &S - let i: auth(F) &Int = s[A]!.foo() - } - `) - - errs := RequireCheckerErrors(t, err, 1) - require.IsType(t, &sema.InvalidAttachmentEntitlementError{}, errs[0]) - }) } func TestCheckEntitlementTypeAnnotation(t *testing.T) { From 3f384d51309e8691e625a599c602e088e2d6dbfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Thu, 10 Oct 2024 15:01:14 -0700 Subject: [PATCH 04/16] forbid change of attachment base type --- runtime/contract_update_validation_test.go | 49 +++++++++++++++++ ..._v0.42_to_v1_contract_upgrade_validator.go | 1 + runtime/stdlib/contract_update_validation.go | 55 +++++++++++++++++-- 3 files changed, 99 insertions(+), 6 deletions(-) diff --git a/runtime/contract_update_validation_test.go b/runtime/contract_update_validation_test.go index 451c4a2def..2ae0bade0e 100644 --- a/runtime/contract_update_validation_test.go +++ b/runtime/contract_update_validation_test.go @@ -3666,3 +3666,52 @@ func TestTypeRemovalPragmaUpdates(t *testing.T) { }, ) } + +func TestAttachmentsUpdates(t *testing.T) { + t.Parallel() + + testWithValidators(t, + "Keep base type", + func(t *testing.T, config Config) { + + const oldCode = ` + access(all) contract Test { + access(all) attachment A for AnyResource {} + } + ` + + const newCode = ` + access(all) contract Test { + access(all) attachment A for AnyResource {} + } + ` + + err := testDeployAndUpdate(t, "Test", oldCode, newCode, config) + require.NoError(t, err) + }, + ) + + testWithValidators(t, + "Change base type", + func(t *testing.T, config Config) { + + const oldCode = ` + access(all) contract Test { + access(all) attachment A for AnyResource {} + } + ` + + const newCode = ` + access(all) contract Test { + access(all) attachment A for AnyStruct {} + } + ` + + err := testDeployAndUpdate(t, "Test", oldCode, newCode, config) + + var expectedErr *stdlib.TypeMismatchError + require.ErrorAs(t, err, &expectedErr) + }, + ) + +} diff --git a/runtime/stdlib/cadence_v0.42_to_v1_contract_upgrade_validator.go b/runtime/stdlib/cadence_v0.42_to_v1_contract_upgrade_validator.go index ee5706967b..ccebf6c2d8 100644 --- a/runtime/stdlib/cadence_v0.42_to_v1_contract_upgrade_validator.go +++ b/runtime/stdlib/cadence_v0.42_to_v1_contract_upgrade_validator.go @@ -121,6 +121,7 @@ func (validator *CadenceV042ToV1ContractUpdateValidator) Validate() error { checkDeclarationUpdatability( validator, + validator.TypeComparator, oldRootDecl, newRootDecl, validator.checkConformanceV1, diff --git a/runtime/stdlib/contract_update_validation.go b/runtime/stdlib/contract_update_validation.go index 92ad1df81e..00cbad8076 100644 --- a/runtime/stdlib/contract_update_validation.go +++ b/runtime/stdlib/contract_update_validation.go @@ -142,6 +142,7 @@ func (validator *ContractUpdateValidator) Validate() error { checkDeclarationUpdatability( validator, + validator.TypeComparator, oldRootDecl, newRootDecl, validator.checkConformance, @@ -249,8 +250,8 @@ func collectRemovedTypePragmas(validator UpdateValidator, pragmas []*ast.PragmaD }) continue } - removedTypeName, isIdentifer := invocationExpression.Arguments[0].Expression.(*ast.IdentifierExpression) - if !isIdentifer { + removedTypeName, isIdentifier := invocationExpression.Arguments[0].Expression.(*ast.IdentifierExpression) + if !isIdentifier { validator.report(&InvalidTypeRemovalPragmaError{ Expression: pragma.Expression, Range: ast.NewUnmeteredRangeFromPositioned(pragma.Expression), @@ -265,6 +266,7 @@ func collectRemovedTypePragmas(validator UpdateValidator, pragmas []*ast.PragmaD func checkDeclarationUpdatability( validator UpdateValidator, + typeComparator *TypeComparator, oldDeclaration ast.Declaration, newDeclaration ast.Declaration, checkConformance checkConformanceFunc, @@ -293,13 +295,35 @@ func checkDeclarationUpdatability( checkFields(validator, oldDeclaration, newDeclaration) - checkNestedDeclarations(validator, oldDeclaration, newDeclaration, checkConformance) + checkNestedDeclarations( + validator, + typeComparator, + oldDeclaration, + newDeclaration, + checkConformance, + ) if newDecl, ok := newDeclaration.(*ast.CompositeDeclaration); ok { if oldDecl, ok := oldDeclaration.(*ast.CompositeDeclaration); ok { checkConformance(oldDecl, newDecl) } } + + // Check if the base type of the attachment has changed. + if oldAttachment, ok := oldDeclaration.(*ast.AttachmentDeclaration); ok && + oldAttachment.DeclarationKind() == common.DeclarationKindAttachment { + + // NOTE: no need to check declaration kinds match, already checked above + if newAttachment, ok := newDeclaration.(*ast.AttachmentDeclaration); ok { + err := typeComparator.CheckNominalTypeEquality( + oldAttachment.BaseType, + newAttachment.BaseType, + ) + if err != nil { + validator.report(err) + } + } + } } func checkFields( @@ -423,6 +447,7 @@ func checkTypeNotRemoved( func checkNestedDeclarations( validator UpdateValidator, + typeComparator *TypeComparator, oldDeclaration ast.Declaration, newDeclaration ast.Declaration, checkConformance checkConformanceFunc, @@ -457,7 +482,13 @@ func checkNestedDeclarations( continue } - checkDeclarationUpdatability(validator, oldNestedDecl, newNestedDecl, checkConformance) + checkDeclarationUpdatability( + validator, + typeComparator, + oldNestedDecl, + newNestedDecl, + checkConformance, + ) // If there's a matching new decl, then remove the old one from the map. delete(oldNominalTypeDecls, newNestedDecl.Identifier.Identifier) @@ -473,7 +504,13 @@ func checkNestedDeclarations( continue } - checkDeclarationUpdatability(validator, oldNestedDecl, newNestedDecl, checkConformance) + checkDeclarationUpdatability( + validator, + typeComparator, + oldNestedDecl, + newNestedDecl, + checkConformance, + ) // If there's a matching new decl, then remove the old one from the map. delete(oldNominalTypeDecls, newNestedDecl.Identifier.Identifier) @@ -489,7 +526,13 @@ func checkNestedDeclarations( continue } - checkDeclarationUpdatability(validator, oldNestedDecl, newNestedDecl, checkConformance) + checkDeclarationUpdatability( + validator, + typeComparator, + oldNestedDecl, + newNestedDecl, + checkConformance, + ) // If there's a matching new decl, then remove the old one from the map. delete(oldNominalTypeDecls, newNestedDecl.Identifier.Identifier) From 1e6ee46d35c0202ece2c8a6bbc338d578dd00446 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Thu, 10 Oct 2024 16:16:38 -0700 Subject: [PATCH 05/16] put attachment base type change validation behind a feature flag --- runtime/config.go | 2 + runtime/contract_update_validation_test.go | 50 +++++++++++++++-- runtime/environment.go | 25 +++++---- runtime/interpreter/config.go | 2 + runtime/stdlib/account.go | 5 +- ..._v0.42_to_v1_contract_upgrade_validator.go | 19 +++++-- runtime/stdlib/contract_update_validation.go | 56 ++++++++++++------- 7 files changed, 117 insertions(+), 42 deletions(-) diff --git a/runtime/config.go b/runtime/config.go index 3e3a273ff1..50b803a188 100644 --- a/runtime/config.go +++ b/runtime/config.go @@ -41,4 +41,6 @@ type Config struct { LegacyContractUpgradeEnabled bool // ContractUpdateTypeRemovalEnabled specifies if type removal is enabled in contract updates ContractUpdateTypeRemovalEnabled bool + // ContractUpdateAttachmentBaseTypeChangeEnabled specifies if attachment base type change is enabled in contract updates + ContractUpdateAttachmentBaseTypeChangeEnabled bool } diff --git a/runtime/contract_update_validation_test.go b/runtime/contract_update_validation_test.go index 2ae0bade0e..fad78918da 100644 --- a/runtime/contract_update_validation_test.go +++ b/runtime/contract_update_validation_test.go @@ -205,6 +205,43 @@ func testWithValidatorsAndTypeRemovalEnabled( } } +func testWithValidatorsAndAttachmentBaseTypeChangeEnabled( + t *testing.T, + name string, + testFunc func(t *testing.T, config Config), +) { + for _, withC1Upgrade := range []bool{true, false} { + withC1Upgrade := withC1Upgrade + name := name + + for _, withAttachmentBaseTypeChangeEnabled := range []bool{true, false} { + withAttachmentBaseTypeChangeEnabled := withAttachmentBaseTypeChangeEnabled + name := name + + switch { + case withC1Upgrade && withAttachmentBaseTypeChangeEnabled: + name = fmt.Sprintf("%s (with C1 validator and attachment base type change enabled)", name) + + case withC1Upgrade: + name = fmt.Sprintf("%s (with C1 validator)", name) + + case withAttachmentBaseTypeChangeEnabled: + name = fmt.Sprintf("%s (with attachment base type change enabled)", name) + } + + t.Run(name, func(t *testing.T) { + t.Parallel() + + config := DefaultTestInterpreterConfig + config.LegacyContractUpgradeEnabled = withC1Upgrade + config.ContractUpdateAttachmentBaseTypeChangeEnabled = withAttachmentBaseTypeChangeEnabled + + testFunc(t, config) + }) + } + } +} + func TestRuntimeContractUpdateValidation(t *testing.T) { t.Parallel() @@ -3670,7 +3707,7 @@ func TestTypeRemovalPragmaUpdates(t *testing.T) { func TestAttachmentsUpdates(t *testing.T) { t.Parallel() - testWithValidators(t, + testWithValidatorsAndAttachmentBaseTypeChangeEnabled(t, "Keep base type", func(t *testing.T, config Config) { @@ -3691,7 +3728,7 @@ func TestAttachmentsUpdates(t *testing.T) { }, ) - testWithValidators(t, + testWithValidatorsAndAttachmentBaseTypeChangeEnabled(t, "Change base type", func(t *testing.T, config Config) { @@ -3709,9 +3746,12 @@ func TestAttachmentsUpdates(t *testing.T) { err := testDeployAndUpdate(t, "Test", oldCode, newCode, config) - var expectedErr *stdlib.TypeMismatchError - require.ErrorAs(t, err, &expectedErr) + if config.ContractUpdateAttachmentBaseTypeChangeEnabled { + require.NoError(t, err) + } else { + var expectedErr *stdlib.TypeMismatchError + require.ErrorAs(t, err, &expectedErr) + } }, ) - } diff --git a/runtime/environment.go b/runtime/environment.go index 95a3ac847c..7c55dbf97d 100644 --- a/runtime/environment.go +++ b/runtime/environment.go @@ -185,18 +185,19 @@ func (e *interpreterEnvironment) newInterpreterConfig() *interpreter.Config { // and disable storage validation after each value modification. // Instead, storage is validated after commits (if validation is enabled), // see interpreterEnvironment.CommitStorage - AtreeStorageValidationEnabled: false, - Debugger: e.config.Debugger, - OnStatement: e.newOnStatementHandler(), - OnMeterComputation: e.newOnMeterComputation(), - OnFunctionInvocation: e.newOnFunctionInvocationHandler(), - OnInvokedFunctionReturn: e.newOnInvokedFunctionReturnHandler(), - CapabilityBorrowHandler: e.newCapabilityBorrowHandler(), - CapabilityCheckHandler: e.newCapabilityCheckHandler(), - LegacyContractUpgradeEnabled: e.config.LegacyContractUpgradeEnabled, - ContractUpdateTypeRemovalEnabled: e.config.ContractUpdateTypeRemovalEnabled, - ValidateAccountCapabilitiesGetHandler: e.newValidateAccountCapabilitiesGetHandler(), - ValidateAccountCapabilitiesPublishHandler: e.newValidateAccountCapabilitiesPublishHandler(), + AtreeStorageValidationEnabled: false, + Debugger: e.config.Debugger, + OnStatement: e.newOnStatementHandler(), + OnMeterComputation: e.newOnMeterComputation(), + OnFunctionInvocation: e.newOnFunctionInvocationHandler(), + OnInvokedFunctionReturn: e.newOnInvokedFunctionReturnHandler(), + CapabilityBorrowHandler: e.newCapabilityBorrowHandler(), + CapabilityCheckHandler: e.newCapabilityCheckHandler(), + LegacyContractUpgradeEnabled: e.config.LegacyContractUpgradeEnabled, + ContractUpdateTypeRemovalEnabled: e.config.ContractUpdateTypeRemovalEnabled, + ContractUpdateAttachmentBaseTypeChangeEnabled: e.config.ContractUpdateAttachmentBaseTypeChangeEnabled, + ValidateAccountCapabilitiesGetHandler: e.newValidateAccountCapabilitiesGetHandler(), + ValidateAccountCapabilitiesPublishHandler: e.newValidateAccountCapabilitiesPublishHandler(), } } diff --git a/runtime/interpreter/config.go b/runtime/interpreter/config.go index dc052342d1..f64413aef5 100644 --- a/runtime/interpreter/config.go +++ b/runtime/interpreter/config.go @@ -74,6 +74,8 @@ type Config struct { LegacyContractUpgradeEnabled bool // ContractUpdateTypeRemovalEnabled specifies if type removal is enabled in contract updates ContractUpdateTypeRemovalEnabled bool + // ContractUpdateAttachmentBaseTypeChangeEnabled specifies if attachment base type change is enabled in contract updates + ContractUpdateAttachmentBaseTypeChangeEnabled bool // ValidateAccountCapabilitiesGetHandler is used to handle when a capability of an account is got. ValidateAccountCapabilitiesGetHandler ValidateAccountCapabilitiesGetHandlerFunc // ValidateAccountCapabilitiesPublishHandler is used to handle when a capability of an account is got. diff --git a/runtime/stdlib/account.go b/runtime/stdlib/account.go index f7eb85b1b6..235dc29e6f 100644 --- a/runtime/stdlib/account.go +++ b/runtime/stdlib/account.go @@ -1679,6 +1679,7 @@ func changeAccountContracts( memoryGauge := invocation.Interpreter.SharedState.Config.MemoryGauge legacyUpgradeEnabled := invocation.Interpreter.SharedState.Config.LegacyContractUpgradeEnabled contractUpdateTypeRemovalEnabled := invocation.Interpreter.SharedState.Config.ContractUpdateTypeRemovalEnabled + contractUpdateAttachmentBaseTypeChangeEnabled := invocation.Interpreter.SharedState.Config.ContractUpdateAttachmentBaseTypeChangeEnabled var oldProgram *ast.Program @@ -1731,7 +1732,9 @@ func changeAccountContracts( ) } - validator = validator.WithTypeRemovalEnabled(contractUpdateTypeRemovalEnabled) + validator = validator. + WithTypeRemovalEnabled(contractUpdateTypeRemovalEnabled). + WithAttachmentBaseTypeChangeEnabled(contractUpdateAttachmentBaseTypeChangeEnabled) err = validator.Validate() handleContractUpdateError(err, newCode) diff --git a/runtime/stdlib/cadence_v0.42_to_v1_contract_upgrade_validator.go b/runtime/stdlib/cadence_v0.42_to_v1_contract_upgrade_validator.go index ccebf6c2d8..d3fc96209b 100644 --- a/runtime/stdlib/cadence_v0.42_to_v1_contract_upgrade_validator.go +++ b/runtime/stdlib/cadence_v0.42_to_v1_contract_upgrade_validator.go @@ -71,10 +71,6 @@ func NewCadenceV042ToV1ContractUpdateValidator( var _ UpdateValidator = &CadenceV042ToV1ContractUpdateValidator{} -func (validator *CadenceV042ToV1ContractUpdateValidator) isTypeRemovalEnabled() bool { - return validator.underlyingUpdateValidator.isTypeRemovalEnabled() -} - func (validator *CadenceV042ToV1ContractUpdateValidator) WithUserDefinedTypeChangeChecker( typeChangeCheckFunc func(oldTypeID common.TypeID, newTypeID common.TypeID) (checked, valid bool), ) *CadenceV042ToV1ContractUpdateValidator { @@ -82,6 +78,10 @@ func (validator *CadenceV042ToV1ContractUpdateValidator) WithUserDefinedTypeChan return validator } +func (validator *CadenceV042ToV1ContractUpdateValidator) isTypeRemovalEnabled() bool { + return validator.underlyingUpdateValidator.isTypeRemovalEnabled() +} + func (validator *CadenceV042ToV1ContractUpdateValidator) WithTypeRemovalEnabled( enabled bool, ) UpdateValidator { @@ -89,6 +89,17 @@ func (validator *CadenceV042ToV1ContractUpdateValidator) WithTypeRemovalEnabled( return validator } +func (validator *CadenceV042ToV1ContractUpdateValidator) isAttachmentBaseTypeChangeEnabled() bool { + return validator.underlyingUpdateValidator.isAttachmentBaseTypeChangeEnabled() +} + +func (validator *CadenceV042ToV1ContractUpdateValidator) WithAttachmentBaseTypeChangeEnabled( + enabled bool, +) UpdateValidator { + validator.underlyingUpdateValidator.WithAttachmentBaseTypeChangeEnabled(enabled) + return validator +} + func (validator *CadenceV042ToV1ContractUpdateValidator) getCurrentDeclaration() ast.Declaration { return validator.underlyingUpdateValidator.getCurrentDeclaration() } diff --git a/runtime/stdlib/contract_update_validation.go b/runtime/stdlib/contract_update_validation.go index 00cbad8076..0113ab439c 100644 --- a/runtime/stdlib/contract_update_validation.go +++ b/runtime/stdlib/contract_update_validation.go @@ -53,6 +53,9 @@ type UpdateValidator interface { isTypeRemovalEnabled() bool WithTypeRemovalEnabled(enabled bool) UpdateValidator + + isAttachmentBaseTypeChangeEnabled() bool + WithAttachmentBaseTypeChangeEnabled(enabled bool) UpdateValidator } type checkConformanceFunc func( @@ -63,15 +66,16 @@ type checkConformanceFunc func( type ContractUpdateValidator struct { *TypeComparator - location common.Location - contractName string - oldProgram *ast.Program - newProgram *ast.Program - currentDecl ast.Declaration - importLocations map[ast.Identifier]common.Location - accountContractNamesProvider AccountContractNamesProvider - errors []error - typeRemovalEnabled bool + location common.Location + contractName string + oldProgram *ast.Program + newProgram *ast.Program + currentDecl ast.Declaration + importLocations map[ast.Identifier]common.Location + accountContractNamesProvider AccountContractNamesProvider + errors []error + typeRemovalEnabled bool + attachmentBaseTypeChangeEnabled bool } // ContractUpdateValidator should implement ast.TypeEqualityChecker @@ -108,6 +112,15 @@ func (validator *ContractUpdateValidator) WithTypeRemovalEnabled(enabled bool) U return validator } +func (validator *ContractUpdateValidator) isAttachmentBaseTypeChangeEnabled() bool { + return validator.attachmentBaseTypeChangeEnabled +} + +func (validator *ContractUpdateValidator) WithAttachmentBaseTypeChangeEnabled(enabled bool) UpdateValidator { + validator.attachmentBaseTypeChangeEnabled = enabled + return validator +} + func (validator *ContractUpdateValidator) getCurrentDeclaration() ast.Declaration { return validator.currentDecl } @@ -309,18 +322,21 @@ func checkDeclarationUpdatability( } } - // Check if the base type of the attachment has changed. - if oldAttachment, ok := oldDeclaration.(*ast.AttachmentDeclaration); ok && - oldAttachment.DeclarationKind() == common.DeclarationKindAttachment { + if !validator.isAttachmentBaseTypeChangeEnabled() { - // NOTE: no need to check declaration kinds match, already checked above - if newAttachment, ok := newDeclaration.(*ast.AttachmentDeclaration); ok { - err := typeComparator.CheckNominalTypeEquality( - oldAttachment.BaseType, - newAttachment.BaseType, - ) - if err != nil { - validator.report(err) + // Check if the base type of the attachment has changed. + if oldAttachment, ok := oldDeclaration.(*ast.AttachmentDeclaration); ok && + oldAttachment.DeclarationKind() == common.DeclarationKindAttachment { + + // NOTE: no need to check declaration kinds match, already checked above + if newAttachment, ok := newDeclaration.(*ast.AttachmentDeclaration); ok { + err := typeComparator.CheckNominalTypeEquality( + oldAttachment.BaseType, + newAttachment.BaseType, + ) + if err != nil { + validator.report(err) + } } } } From 78495040812f57f720ad0f795c27d35aa8bb42ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Thu, 10 Oct 2024 16:36:41 -0700 Subject: [PATCH 06/16] put attachment conformances behind feature flag --- runtime/config.go | 2 + runtime/environment.go | 1 + runtime/sema/check_composite_declaration.go | 37 +++++---- runtime/sema/config.go | 2 + runtime/tests/checker/attachments_test.go | 86 ++++++++++++++++++--- 5 files changed, 101 insertions(+), 27 deletions(-) diff --git a/runtime/config.go b/runtime/config.go index 50b803a188..23b7e917df 100644 --- a/runtime/config.go +++ b/runtime/config.go @@ -37,6 +37,8 @@ type Config struct { CoverageReport *CoverageReport // AttachmentsEnabled specifies if attachments are enabled AttachmentsEnabled bool + // AttachmentConformancesEnabled specifies if attachment conformances are enabled + AttachmentConformancesEnabled bool // LegacyContractUpgradeEnabled enabled specifies whether to use the old parser when parsing an old contract LegacyContractUpgradeEnabled bool // ContractUpdateTypeRemovalEnabled specifies if type removal is enabled in contract updates diff --git a/runtime/environment.go b/runtime/environment.go index 7c55dbf97d..afbb9f763c 100644 --- a/runtime/environment.go +++ b/runtime/environment.go @@ -211,6 +211,7 @@ func (e *interpreterEnvironment) newCheckerConfig() *sema.Config { ImportHandler: e.resolveImport, CheckHandler: e.newCheckHandler(), AttachmentsEnabled: e.config.AttachmentsEnabled, + AttachmentConformancesEnabled: e.config.AttachmentConformancesEnabled, } } diff --git a/runtime/sema/check_composite_declaration.go b/runtime/sema/check_composite_declaration.go index cb2fac91bd..bcae42aec7 100644 --- a/runtime/sema/check_composite_declaration.go +++ b/runtime/sema/check_composite_declaration.go @@ -686,23 +686,30 @@ func (checker *Checker) declareCompositeType(declaration ast.CompositeLikeDeclar compositeType.EnumRawType = checker.enumRawType(declaration.(*ast.CompositeDeclaration)) case common.CompositeKindAttachment: - // Attachments may not conform to interfaces - conformanceList := declaration.ConformanceList() - conformanceCount := len(conformanceList) - if conformanceCount > 0 { - firstConformance := conformanceList[0] - lastConformance := conformanceList[conformanceCount-1] + if checker.Config.AttachmentConformancesEnabled { + compositeType.ExplicitInterfaceConformances = + checker.explicitInterfaceConformances(declaration, compositeType) - checker.report( - &InvalidAttachmentConformancesError{ - Range: ast.NewRange( - checker.memoryGauge, - firstConformance.StartPosition(), - lastConformance.EndPosition(checker.memoryGauge), - ), - }, - ) + } else { + // Attachments may not conform to interfaces + + conformanceList := declaration.ConformanceList() + conformanceCount := len(conformanceList) + if conformanceCount > 0 { + firstConformance := conformanceList[0] + lastConformance := conformanceList[conformanceCount-1] + + checker.report( + &InvalidAttachmentConformancesError{ + Range: ast.NewRange( + checker.memoryGauge, + firstConformance.StartPosition(), + lastConformance.EndPosition(checker.memoryGauge), + ), + }, + ) + } } default: diff --git a/runtime/sema/config.go b/runtime/sema/config.go index 06f6e9ce95..a48e620522 100644 --- a/runtime/sema/config.go +++ b/runtime/sema/config.go @@ -55,4 +55,6 @@ type Config struct { AllowStaticDeclarations bool // AttachmentsEnabled determines if attachments are enabled AttachmentsEnabled bool + // AttachmentConformancesEnabled determines if attachment conformances are enabled + AttachmentConformancesEnabled bool } diff --git a/runtime/tests/checker/attachments_test.go b/runtime/tests/checker/attachments_test.go index f6a3c75ae3..6a890e0124 100644 --- a/runtime/tests/checker/attachments_test.go +++ b/runtime/tests/checker/attachments_test.go @@ -623,34 +623,96 @@ func TestCheckInvalidAttachmentConformance(t *testing.T) { t.Parallel() - t.Run("struct", func(t *testing.T) { + t.Run("struct, enabled", func(t *testing.T) { t.Parallel() - _, err := ParseAndCheck(t, ` - struct S {} + _, err := ParseAndCheckWithOptions(t, + ` + struct S {} - struct interface SI {} + struct interface SI {} - attachment Test for S: SI {} - `) + attachment Test for S: SI {} + `, + ParseAndCheckOptions{ + Config: &sema.Config{ + AttachmentsEnabled: true, + AttachmentConformancesEnabled: true, + }, + }, + ) + + require.NoError(t, err) + }) + + t.Run("struct, disabled", func(t *testing.T) { + + t.Parallel() + + _, err := ParseAndCheckWithOptions(t, + ` + struct S {} + + struct interface SI {} + + attachment Test for S: SI {} + `, + ParseAndCheckOptions{ + Config: &sema.Config{ + AttachmentsEnabled: true, + AttachmentConformancesEnabled: false, + }, + }, + ) errs := RequireCheckerErrors(t, err, 1) assert.IsType(t, &sema.InvalidAttachmentConformancesError{}, errs[0]) }) - t.Run("resource", func(t *testing.T) { + t.Run("resource, enabled", func(t *testing.T) { t.Parallel() - _, err := ParseAndCheck(t, ` - resource R {} + _, err := ParseAndCheckWithOptions(t, + ` + resource R {} - resource interface RI {} + resource interface RI {} - attachment Test for R: RI {} - `) + attachment Test for R: RI {} + `, + ParseAndCheckOptions{ + Config: &sema.Config{ + AttachmentsEnabled: true, + AttachmentConformancesEnabled: true, + }, + }, + ) + + require.NoError(t, err) + }) + + t.Run("resource, disabled", func(t *testing.T) { + + t.Parallel() + + _, err := ParseAndCheckWithOptions(t, + ` + resource R {} + + resource interface RI {} + + attachment Test for R: RI {} + `, + ParseAndCheckOptions{ + Config: &sema.Config{ + AttachmentsEnabled: true, + AttachmentConformancesEnabled: false, + }, + }, + ) errs := RequireCheckerErrors(t, err, 1) From 605fc9563aca1b6810f581198b080c30b6e1f5f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Fri, 11 Oct 2024 10:50:48 -0700 Subject: [PATCH 07/16] put sibling type check for members behind a feature flag --- runtime/config.go | 2 + runtime/environment.go | 1 + runtime/runtime_test.go | 81 +++++++++++++-------- runtime/sema/check_composite_declaration.go | 2 +- runtime/sema/config.go | 2 + 5 files changed, 58 insertions(+), 30 deletions(-) diff --git a/runtime/config.go b/runtime/config.go index 23b7e917df..c81d396b43 100644 --- a/runtime/config.go +++ b/runtime/config.go @@ -39,6 +39,8 @@ type Config struct { AttachmentsEnabled bool // AttachmentConformancesEnabled specifies if attachment conformances are enabled AttachmentConformancesEnabled bool + // MemberSiblingTypeCheckEnabled specifies if declaring members checks for sibling type declarations + MemberSiblingTypeCheckEnabled bool // LegacyContractUpgradeEnabled enabled specifies whether to use the old parser when parsing an old contract LegacyContractUpgradeEnabled bool // ContractUpdateTypeRemovalEnabled specifies if type removal is enabled in contract updates diff --git a/runtime/environment.go b/runtime/environment.go index afbb9f763c..ae9fe82cba 100644 --- a/runtime/environment.go +++ b/runtime/environment.go @@ -212,6 +212,7 @@ func (e *interpreterEnvironment) newCheckerConfig() *sema.Config { CheckHandler: e.newCheckHandler(), AttachmentsEnabled: e.config.AttachmentsEnabled, AttachmentConformancesEnabled: e.config.AttachmentConformancesEnabled, + MemberSiblingTypeCheckEnabled: e.config.MemberSiblingTypeCheckEnabled, } } diff --git a/runtime/runtime_test.go b/runtime/runtime_test.go index 2b57648779..393d060204 100644 --- a/runtime/runtime_test.go +++ b/runtime/runtime_test.go @@ -11495,42 +11495,46 @@ func TestRuntimeBuiltInFunctionConfusion(t *testing.T) { } ` - runtime := NewTestInterpreterRuntime() - address := common.MustBytesToAddress([]byte{0x1}) - accountCodes := map[common.AddressLocation][]byte{} - var events []cadence.Event - var loggedMessages []string + newRuntimeInterface := func() Interface { - runtimeInterface := &TestRuntimeInterface{ - Storage: NewTestLedger(nil, nil), - OnGetSigningAccounts: func() ([]common.Address, error) { - return []common.Address{address}, nil - }, - OnResolveLocation: NewSingleIdentifierLocationResolver(t), - OnUpdateAccountContractCode: func(location common.AddressLocation, code []byte) error { - accountCodes[location] = code - return nil - }, - OnGetAccountContractCode: func(location common.AddressLocation) (code []byte, err error) { - code = accountCodes[location] - return code, nil - }, - OnEmitEvent: func(event cadence.Event) error { - events = append(events, event) - return nil - }, - OnProgramLog: func(message string) { - loggedMessages = append(loggedMessages, message) - }, + accountCodes := map[common.AddressLocation][]byte{} + var events []cadence.Event + var loggedMessages []string + + return &TestRuntimeInterface{ + Storage: NewTestLedger(nil, nil), + OnGetSigningAccounts: func() ([]common.Address, error) { + return []common.Address{address}, nil + }, + OnResolveLocation: NewSingleIdentifierLocationResolver(t), + OnUpdateAccountContractCode: func(location common.AddressLocation, code []byte) error { + accountCodes[location] = code + return nil + }, + OnGetAccountContractCode: func(location common.AddressLocation) (code []byte, err error) { + code = accountCodes[location] + return code, nil + }, + OnEmitEvent: func(event cadence.Event) error { + events = append(events, event) + return nil + }, + OnProgramLog: func(message string) { + loggedMessages = append(loggedMessages, message) + }, + } } nextTransactionLocation := NewTransactionLocationGenerator() - // Deploy contract + // Deploy contract without check enabled - err := runtime.ExecuteTransaction( + err := NewTestInterpreterRuntimeWithConfig(Config{ + AtreeValidationEnabled: true, + MemberSiblingTypeCheckEnabled: false, + }).ExecuteTransaction( Script{ Source: DeploymentTransaction( "Foo", @@ -11538,7 +11542,26 @@ func TestRuntimeBuiltInFunctionConfusion(t *testing.T) { ), }, Context{ - Interface: runtimeInterface, + Interface: newRuntimeInterface(), + Location: nextTransactionLocation(), + }, + ) + require.NoError(t, err) + + // Deploy contract with check enabled + + err = NewTestInterpreterRuntimeWithConfig(Config{ + AtreeValidationEnabled: true, + MemberSiblingTypeCheckEnabled: true, + }).ExecuteTransaction( + Script{ + Source: DeploymentTransaction( + "Foo", + []byte(contract), + ), + }, + Context{ + Interface: newRuntimeInterface(), Location: nextTransactionLocation(), }, ) diff --git a/runtime/sema/check_composite_declaration.go b/runtime/sema/check_composite_declaration.go index bcae42aec7..f8280702ac 100644 --- a/runtime/sema/check_composite_declaration.go +++ b/runtime/sema/check_composite_declaration.go @@ -1748,7 +1748,7 @@ func (checker *Checker) defaultMembersAndOrigins( } } - if nestedTypes != nil { + if nestedTypes != nil && checker.Config.MemberSiblingTypeCheckEnabled { if _, ok := nestedTypes.Get(name); ok { // TODO: provide previous position checker.report( diff --git a/runtime/sema/config.go b/runtime/sema/config.go index a48e620522..2c760d701b 100644 --- a/runtime/sema/config.go +++ b/runtime/sema/config.go @@ -57,4 +57,6 @@ type Config struct { AttachmentsEnabled bool // AttachmentConformancesEnabled determines if attachment conformances are enabled AttachmentConformancesEnabled bool + // MemberSiblingTypeCheckEnabled determines if declaring members checks for sibling type declarations + MemberSiblingTypeCheckEnabled bool } From 74b013566bb2c3005960fa5d275d4f466a3f7a82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Fri, 11 Oct 2024 14:01:15 -0700 Subject: [PATCH 08/16] invert feature flag --- runtime/config.go | 4 ++-- runtime/environment.go | 2 +- runtime/runtime_test.go | 8 ++++---- runtime/sema/check_composite_declaration.go | 2 +- runtime/sema/config.go | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/runtime/config.go b/runtime/config.go index c81d396b43..93f3d37844 100644 --- a/runtime/config.go +++ b/runtime/config.go @@ -39,8 +39,8 @@ type Config struct { AttachmentsEnabled bool // AttachmentConformancesEnabled specifies if attachment conformances are enabled AttachmentConformancesEnabled bool - // MemberSiblingTypeCheckEnabled specifies if declaring members checks for sibling type declarations - MemberSiblingTypeCheckEnabled bool + // MemberSiblingTypeOverrideEnabled specifies if declaring members checks for sibling type declarations + MemberSiblingTypeOverrideEnabled bool // LegacyContractUpgradeEnabled enabled specifies whether to use the old parser when parsing an old contract LegacyContractUpgradeEnabled bool // ContractUpdateTypeRemovalEnabled specifies if type removal is enabled in contract updates diff --git a/runtime/environment.go b/runtime/environment.go index ae9fe82cba..bef0cc5361 100644 --- a/runtime/environment.go +++ b/runtime/environment.go @@ -212,7 +212,7 @@ func (e *interpreterEnvironment) newCheckerConfig() *sema.Config { CheckHandler: e.newCheckHandler(), AttachmentsEnabled: e.config.AttachmentsEnabled, AttachmentConformancesEnabled: e.config.AttachmentConformancesEnabled, - MemberSiblingTypeCheckEnabled: e.config.MemberSiblingTypeCheckEnabled, + MemberSiblingTypeOverrideEnabled: e.config.MemberSiblingTypeOverrideEnabled, } } diff --git a/runtime/runtime_test.go b/runtime/runtime_test.go index 393d060204..b5375fb799 100644 --- a/runtime/runtime_test.go +++ b/runtime/runtime_test.go @@ -11532,8 +11532,8 @@ func TestRuntimeBuiltInFunctionConfusion(t *testing.T) { // Deploy contract without check enabled err := NewTestInterpreterRuntimeWithConfig(Config{ - AtreeValidationEnabled: true, - MemberSiblingTypeCheckEnabled: false, + AtreeValidationEnabled: true, + MemberSiblingTypeOverrideEnabled: true, }).ExecuteTransaction( Script{ Source: DeploymentTransaction( @@ -11551,8 +11551,8 @@ func TestRuntimeBuiltInFunctionConfusion(t *testing.T) { // Deploy contract with check enabled err = NewTestInterpreterRuntimeWithConfig(Config{ - AtreeValidationEnabled: true, - MemberSiblingTypeCheckEnabled: true, + AtreeValidationEnabled: true, + MemberSiblingTypeOverrideEnabled: false, }).ExecuteTransaction( Script{ Source: DeploymentTransaction( diff --git a/runtime/sema/check_composite_declaration.go b/runtime/sema/check_composite_declaration.go index f8280702ac..75b8c3a8d6 100644 --- a/runtime/sema/check_composite_declaration.go +++ b/runtime/sema/check_composite_declaration.go @@ -1748,7 +1748,7 @@ func (checker *Checker) defaultMembersAndOrigins( } } - if nestedTypes != nil && checker.Config.MemberSiblingTypeCheckEnabled { + if nestedTypes != nil && !checker.Config.MemberSiblingTypeOverrideEnabled { if _, ok := nestedTypes.Get(name); ok { // TODO: provide previous position checker.report( diff --git a/runtime/sema/config.go b/runtime/sema/config.go index 2c760d701b..c8e72c695e 100644 --- a/runtime/sema/config.go +++ b/runtime/sema/config.go @@ -57,6 +57,6 @@ type Config struct { AttachmentsEnabled bool // AttachmentConformancesEnabled determines if attachment conformances are enabled AttachmentConformancesEnabled bool - // MemberSiblingTypeCheckEnabled determines if declaring members checks for sibling type declarations - MemberSiblingTypeCheckEnabled bool + // MemberSiblingTypeOverrideEnabled determines if declaring members checks for sibling type declarations + MemberSiblingTypeOverrideEnabled bool } From 03826a54c49554ae5813f45e99a206fc4b95056e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Fri, 11 Oct 2024 14:41:17 -0700 Subject: [PATCH 09/16] enable v1.0.1 features based on current version --- runtime/config.go | 6 - runtime/contract_update_validation_test.go | 121 +++++++++++-------- runtime/empty.go | 4 + runtime/environment.go | 47 ++++--- runtime/interface.go | 2 + runtime/runtime_test.go | 19 +-- runtime/tests/runtime_utils/testinterface.go | 8 ++ 7 files changed, 126 insertions(+), 81 deletions(-) diff --git a/runtime/config.go b/runtime/config.go index 93f3d37844..3e3a273ff1 100644 --- a/runtime/config.go +++ b/runtime/config.go @@ -37,14 +37,8 @@ type Config struct { CoverageReport *CoverageReport // AttachmentsEnabled specifies if attachments are enabled AttachmentsEnabled bool - // AttachmentConformancesEnabled specifies if attachment conformances are enabled - AttachmentConformancesEnabled bool - // MemberSiblingTypeOverrideEnabled specifies if declaring members checks for sibling type declarations - MemberSiblingTypeOverrideEnabled bool // LegacyContractUpgradeEnabled enabled specifies whether to use the old parser when parsing an old contract LegacyContractUpgradeEnabled bool // ContractUpdateTypeRemovalEnabled specifies if type removal is enabled in contract updates ContractUpdateTypeRemovalEnabled bool - // ContractUpdateAttachmentBaseTypeChangeEnabled specifies if attachment base type change is enabled in contract updates - ContractUpdateAttachmentBaseTypeChangeEnabled bool } diff --git a/runtime/contract_update_validation_test.go b/runtime/contract_update_validation_test.go index fad78918da..1fc995699b 100644 --- a/runtime/contract_update_validation_test.go +++ b/runtime/contract_update_validation_test.go @@ -83,6 +83,10 @@ func newContractRemovalTransaction(contractName string) string { } func newContractDeploymentTransactor(t *testing.T, config Config) func(code string) error { + return newContractDeploymentTransactorWithVersion(t, config, "") +} + +func newContractDeploymentTransactorWithVersion(t *testing.T, config Config, version string) func(code string) error { rt := NewTestInterpreterRuntimeWithConfig(config) @@ -112,6 +116,9 @@ func newContractDeploymentTransactor(t *testing.T, config Config) func(code stri events = append(events, event) return nil }, + OnCurrentVersion: func() string { + return version + }, } nextTransactionLocation := NewTransactionLocationGenerator() @@ -132,7 +139,18 @@ func newContractDeploymentTransactor(t *testing.T, config Config) func(code stri // testDeployAndUpdate deploys a contract in one transaction, // then updates the contract in another transaction func testDeployAndUpdate(t *testing.T, name string, oldCode string, newCode string, config Config) error { - executeTransaction := newContractDeploymentTransactor(t, config) + return testDeployAndUpdateWithVersion(t, name, oldCode, newCode, config, "") +} + +func testDeployAndUpdateWithVersion( + t *testing.T, + name string, + oldCode string, + newCode string, + config Config, + version string, +) error { + executeTransaction := newContractDeploymentTransactorWithVersion(t, config, version) err := executeTransaction(newContractAddTransaction(name, oldCode)) require.NoError(t, err) @@ -205,43 +223,6 @@ func testWithValidatorsAndTypeRemovalEnabled( } } -func testWithValidatorsAndAttachmentBaseTypeChangeEnabled( - t *testing.T, - name string, - testFunc func(t *testing.T, config Config), -) { - for _, withC1Upgrade := range []bool{true, false} { - withC1Upgrade := withC1Upgrade - name := name - - for _, withAttachmentBaseTypeChangeEnabled := range []bool{true, false} { - withAttachmentBaseTypeChangeEnabled := withAttachmentBaseTypeChangeEnabled - name := name - - switch { - case withC1Upgrade && withAttachmentBaseTypeChangeEnabled: - name = fmt.Sprintf("%s (with C1 validator and attachment base type change enabled)", name) - - case withC1Upgrade: - name = fmt.Sprintf("%s (with C1 validator)", name) - - case withAttachmentBaseTypeChangeEnabled: - name = fmt.Sprintf("%s (with attachment base type change enabled)", name) - } - - t.Run(name, func(t *testing.T) { - t.Parallel() - - config := DefaultTestInterpreterConfig - config.LegacyContractUpgradeEnabled = withC1Upgrade - config.ContractUpdateAttachmentBaseTypeChangeEnabled = withAttachmentBaseTypeChangeEnabled - - testFunc(t, config) - }) - } - } -} - func TestRuntimeContractUpdateValidation(t *testing.T) { t.Parallel() @@ -3707,8 +3688,8 @@ func TestTypeRemovalPragmaUpdates(t *testing.T) { func TestAttachmentsUpdates(t *testing.T) { t.Parallel() - testWithValidatorsAndAttachmentBaseTypeChangeEnabled(t, - "Keep base type", + testWithValidators(t, + "Keep base type, v1.0.1", func(t *testing.T, config Config) { const oldCode = ` @@ -3723,13 +3704,13 @@ func TestAttachmentsUpdates(t *testing.T) { } ` - err := testDeployAndUpdate(t, "Test", oldCode, newCode, config) + err := testDeployAndUpdateWithVersion(t, "Test", oldCode, newCode, config, "v1.0.1") require.NoError(t, err) }, ) - testWithValidatorsAndAttachmentBaseTypeChangeEnabled(t, - "Change base type", + testWithValidators(t, + "Keep base type, v1.0.2", func(t *testing.T, config Config) { const oldCode = ` @@ -3740,18 +3721,54 @@ func TestAttachmentsUpdates(t *testing.T) { const newCode = ` access(all) contract Test { - access(all) attachment A for AnyStruct {} + access(all) attachment A for AnyResource {} } ` - err := testDeployAndUpdate(t, "Test", oldCode, newCode, config) - - if config.ContractUpdateAttachmentBaseTypeChangeEnabled { - require.NoError(t, err) - } else { - var expectedErr *stdlib.TypeMismatchError - require.ErrorAs(t, err, &expectedErr) - } + err := testDeployAndUpdateWithVersion(t, "Test", oldCode, newCode, config, "v1.0.2") + require.NoError(t, err) }, ) + + testWithValidators(t, + "Change base type, v1.0.1", + func(t *testing.T, config Config) { + + const oldCode = ` + access(all) contract Test { + access(all) attachment A for AnyResource {} + } + ` + + const newCode = ` + access(all) contract Test { + access(all) attachment A for AnyStruct {} + } + ` + + err := testDeployAndUpdateWithVersion(t, "Test", oldCode, newCode, config, "v1.0.1") + require.NoError(t, err) + }) + + testWithValidators(t, + "Change base type, v1.0.2", + func(t *testing.T, config Config) { + + const oldCode = ` + access(all) contract Test { + access(all) attachment A for AnyResource {} + } + ` + + const newCode = ` + access(all) contract Test { + access(all) attachment A for AnyStruct {} + } + ` + + err := testDeployAndUpdateWithVersion(t, "Test", oldCode, newCode, config, "v1.0.2") + + var expectedErr *stdlib.TypeMismatchError + require.ErrorAs(t, err, &expectedErr) + }) } diff --git a/runtime/empty.go b/runtime/empty.go index 86b5b0abce..103c318e90 100644 --- a/runtime/empty.go +++ b/runtime/empty.go @@ -260,3 +260,7 @@ func (EmptyRuntimeInterface) ValidateAccountCapabilitiesPublish( ) (bool, error) { panic("unexpected call to ValidateAccountCapabilitiesPublish") } + +func (EmptyRuntimeInterface) CurrentVersion() string { + panic("unexpected call to CurrentVersion") +} diff --git a/runtime/environment.go b/runtime/environment.go index bef0cc5361..882e3dca71 100644 --- a/runtime/environment.go +++ b/runtime/environment.go @@ -22,6 +22,7 @@ import ( "time" "go.opentelemetry.io/otel/attribute" + "golang.org/x/mod/semver" "github.com/onflow/cadence" "github.com/onflow/cadence/runtime/activations" @@ -185,19 +186,18 @@ func (e *interpreterEnvironment) newInterpreterConfig() *interpreter.Config { // and disable storage validation after each value modification. // Instead, storage is validated after commits (if validation is enabled), // see interpreterEnvironment.CommitStorage - AtreeStorageValidationEnabled: false, - Debugger: e.config.Debugger, - OnStatement: e.newOnStatementHandler(), - OnMeterComputation: e.newOnMeterComputation(), - OnFunctionInvocation: e.newOnFunctionInvocationHandler(), - OnInvokedFunctionReturn: e.newOnInvokedFunctionReturnHandler(), - CapabilityBorrowHandler: e.newCapabilityBorrowHandler(), - CapabilityCheckHandler: e.newCapabilityCheckHandler(), - LegacyContractUpgradeEnabled: e.config.LegacyContractUpgradeEnabled, - ContractUpdateTypeRemovalEnabled: e.config.ContractUpdateTypeRemovalEnabled, - ContractUpdateAttachmentBaseTypeChangeEnabled: e.config.ContractUpdateAttachmentBaseTypeChangeEnabled, - ValidateAccountCapabilitiesGetHandler: e.newValidateAccountCapabilitiesGetHandler(), - ValidateAccountCapabilitiesPublishHandler: e.newValidateAccountCapabilitiesPublishHandler(), + AtreeStorageValidationEnabled: false, + Debugger: e.config.Debugger, + OnStatement: e.newOnStatementHandler(), + OnMeterComputation: e.newOnMeterComputation(), + OnFunctionInvocation: e.newOnFunctionInvocationHandler(), + OnInvokedFunctionReturn: e.newOnInvokedFunctionReturnHandler(), + CapabilityBorrowHandler: e.newCapabilityBorrowHandler(), + CapabilityCheckHandler: e.newCapabilityCheckHandler(), + LegacyContractUpgradeEnabled: e.config.LegacyContractUpgradeEnabled, + ContractUpdateTypeRemovalEnabled: e.config.ContractUpdateTypeRemovalEnabled, + ValidateAccountCapabilitiesGetHandler: e.newValidateAccountCapabilitiesGetHandler(), + ValidateAccountCapabilitiesPublishHandler: e.newValidateAccountCapabilitiesPublishHandler(), } } @@ -211,8 +211,6 @@ func (e *interpreterEnvironment) newCheckerConfig() *sema.Config { ImportHandler: e.resolveImport, CheckHandler: e.newCheckHandler(), AttachmentsEnabled: e.config.AttachmentsEnabled, - AttachmentConformancesEnabled: e.config.AttachmentConformancesEnabled, - MemberSiblingTypeOverrideEnabled: e.config.MemberSiblingTypeOverrideEnabled, } } @@ -244,6 +242,8 @@ func (e *interpreterEnvironment) Configure( e.InterpreterConfig.Storage = storage e.coverageReport = coverageReport e.stackDepthLimiter.depth = 0 + + e.configureVersionedFeatures() } func (e *interpreterEnvironment) DeclareValue(valueDeclaration stdlib.StandardLibraryValue, location common.Location) { @@ -1461,3 +1461,20 @@ func (e *interpreterEnvironment) newValidateAccountCapabilitiesPublishHandler() return ok, err } } + +func (e *interpreterEnvironment) configureVersionedFeatures() { + var currentVersion string + errors.WrapPanic(func() { + currentVersion = e.runtimeInterface.CurrentVersion() + }) + enableOldBehaviour := useV101Behaviour(currentVersion) + + e.CheckerConfig.AttachmentConformancesEnabled = enableOldBehaviour + e.CheckerConfig.MemberSiblingTypeOverrideEnabled = enableOldBehaviour + e.InterpreterConfig.ContractUpdateAttachmentBaseTypeChangeEnabled = enableOldBehaviour +} + +func useV101Behaviour(currentVersion string) bool { + return currentVersion == "" || + semver.Compare(currentVersion, "v1.0.1") <= 0 +} diff --git a/runtime/interface.go b/runtime/interface.go index 9f20ba8f31..ea6ff29b4d 100644 --- a/runtime/interface.go +++ b/runtime/interface.go @@ -161,6 +161,8 @@ type Interface interface { path interpreter.PathValue, capabilityBorrowType *interpreter.ReferenceStaticType, ) (bool, error) + + CurrentVersion() string } type MeterInterface interface { diff --git a/runtime/runtime_test.go b/runtime/runtime_test.go index b5375fb799..f24973db89 100644 --- a/runtime/runtime_test.go +++ b/runtime/runtime_test.go @@ -11497,6 +11497,8 @@ func TestRuntimeBuiltInFunctionConfusion(t *testing.T) { address := common.MustBytesToAddress([]byte{0x1}) + var currentVersion string + newRuntimeInterface := func() Interface { accountCodes := map[common.AddressLocation][]byte{} @@ -11524,17 +11526,19 @@ func TestRuntimeBuiltInFunctionConfusion(t *testing.T) { OnProgramLog: func(message string) { loggedMessages = append(loggedMessages, message) }, + OnCurrentVersion: func() string { + return currentVersion + }, } } + runtime := NewTestInterpreterRuntime() + nextTransactionLocation := NewTransactionLocationGenerator() // Deploy contract without check enabled - err := NewTestInterpreterRuntimeWithConfig(Config{ - AtreeValidationEnabled: true, - MemberSiblingTypeOverrideEnabled: true, - }).ExecuteTransaction( + err := runtime.ExecuteTransaction( Script{ Source: DeploymentTransaction( "Foo", @@ -11550,10 +11554,9 @@ func TestRuntimeBuiltInFunctionConfusion(t *testing.T) { // Deploy contract with check enabled - err = NewTestInterpreterRuntimeWithConfig(Config{ - AtreeValidationEnabled: true, - MemberSiblingTypeOverrideEnabled: false, - }).ExecuteTransaction( + currentVersion = "v1.0.2" + + err = runtime.ExecuteTransaction( Script{ Source: DeploymentTransaction( "Foo", diff --git a/runtime/tests/runtime_utils/testinterface.go b/runtime/tests/runtime_utils/testinterface.go index e387075c54..b2fd4579dc 100644 --- a/runtime/tests/runtime_utils/testinterface.go +++ b/runtime/tests/runtime_utils/testinterface.go @@ -137,6 +137,7 @@ type TestRuntimeInterface struct { path interpreter.PathValue, capabilityBorrowType *interpreter.ReferenceStaticType, ) (bool, error) + OnCurrentVersion func() string lastUUID uint64 accountIDs map[common.Address]uint64 @@ -669,3 +670,10 @@ func (i *TestRuntimeInterface) ValidateAccountCapabilitiesPublish( capabilityBorrowType, ) } + +func (i *TestRuntimeInterface) CurrentVersion() string { + if i.OnCurrentVersion == nil { + return "" + } + return i.OnCurrentVersion() +} From 8ae61ac8bb3d739b9dcdbf6796576b7ecaf1c1ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Wed, 16 Oct 2024 14:14:45 -0700 Subject: [PATCH 10/16] rename new version function --- runtime/contract_update_validation_test.go | 2 +- runtime/empty.go | 4 ++-- runtime/environment.go | 6 +++--- runtime/interface.go | 2 +- runtime/runtime_test.go | 2 +- runtime/tests/runtime_utils/testinterface.go | 8 ++++---- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/runtime/contract_update_validation_test.go b/runtime/contract_update_validation_test.go index 1fc995699b..ce0203ea11 100644 --- a/runtime/contract_update_validation_test.go +++ b/runtime/contract_update_validation_test.go @@ -116,7 +116,7 @@ func newContractDeploymentTransactorWithVersion(t *testing.T, config Config, ver events = append(events, event) return nil }, - OnCurrentVersion: func() string { + OnMinimumRequiredVersion: func() string { return version }, } diff --git a/runtime/empty.go b/runtime/empty.go index 103c318e90..89991e0539 100644 --- a/runtime/empty.go +++ b/runtime/empty.go @@ -261,6 +261,6 @@ func (EmptyRuntimeInterface) ValidateAccountCapabilitiesPublish( panic("unexpected call to ValidateAccountCapabilitiesPublish") } -func (EmptyRuntimeInterface) CurrentVersion() string { - panic("unexpected call to CurrentVersion") +func (EmptyRuntimeInterface) MinimumRequiredVersion() string { + panic("unexpected call to MinimumRequiredVersion") } diff --git a/runtime/environment.go b/runtime/environment.go index 882e3dca71..970bb4387f 100644 --- a/runtime/environment.go +++ b/runtime/environment.go @@ -1463,11 +1463,11 @@ func (e *interpreterEnvironment) newValidateAccountCapabilitiesPublishHandler() } func (e *interpreterEnvironment) configureVersionedFeatures() { - var currentVersion string + var minimumRequiredVersion string errors.WrapPanic(func() { - currentVersion = e.runtimeInterface.CurrentVersion() + minimumRequiredVersion = e.runtimeInterface.MinimumRequiredVersion() }) - enableOldBehaviour := useV101Behaviour(currentVersion) + enableOldBehaviour := useV101Behaviour(minimumRequiredVersion) e.CheckerConfig.AttachmentConformancesEnabled = enableOldBehaviour e.CheckerConfig.MemberSiblingTypeOverrideEnabled = enableOldBehaviour diff --git a/runtime/interface.go b/runtime/interface.go index ea6ff29b4d..f93ae5100a 100644 --- a/runtime/interface.go +++ b/runtime/interface.go @@ -162,7 +162,7 @@ type Interface interface { capabilityBorrowType *interpreter.ReferenceStaticType, ) (bool, error) - CurrentVersion() string + MinimumRequiredVersion() string } type MeterInterface interface { diff --git a/runtime/runtime_test.go b/runtime/runtime_test.go index f24973db89..5a91ab61a7 100644 --- a/runtime/runtime_test.go +++ b/runtime/runtime_test.go @@ -11526,7 +11526,7 @@ func TestRuntimeBuiltInFunctionConfusion(t *testing.T) { OnProgramLog: func(message string) { loggedMessages = append(loggedMessages, message) }, - OnCurrentVersion: func() string { + OnMinimumRequiredVersion: func() string { return currentVersion }, } diff --git a/runtime/tests/runtime_utils/testinterface.go b/runtime/tests/runtime_utils/testinterface.go index b2fd4579dc..6bf9fbc1d5 100644 --- a/runtime/tests/runtime_utils/testinterface.go +++ b/runtime/tests/runtime_utils/testinterface.go @@ -137,7 +137,7 @@ type TestRuntimeInterface struct { path interpreter.PathValue, capabilityBorrowType *interpreter.ReferenceStaticType, ) (bool, error) - OnCurrentVersion func() string + OnMinimumRequiredVersion func() string lastUUID uint64 accountIDs map[common.Address]uint64 @@ -671,9 +671,9 @@ func (i *TestRuntimeInterface) ValidateAccountCapabilitiesPublish( ) } -func (i *TestRuntimeInterface) CurrentVersion() string { - if i.OnCurrentVersion == nil { +func (i *TestRuntimeInterface) MinimumRequiredVersion() string { + if i.OnMinimumRequiredVersion == nil { return "" } - return i.OnCurrentVersion() + return i.OnMinimumRequiredVersion() } From 88dbd9d4cede299bfb567be291a2de7b14ca8e78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Wed, 16 Oct 2024 15:59:08 -0700 Subject: [PATCH 11/16] update to latest version of golang.org/x/crypto --- go.mod | 13 +++++++------ go.sum | 31 ++++++++++++++++--------------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/go.mod b/go.mod index f650c26942..e3b766d7e3 100644 --- a/go.mod +++ b/go.mod @@ -22,10 +22,10 @@ require ( github.com/turbolent/prettier v0.0.0-20220320183459-661cc755135d go.opentelemetry.io/otel v1.8.0 go.uber.org/goleak v1.1.10 - golang.org/x/crypto v0.1.0 - golang.org/x/mod v0.14.0 - golang.org/x/text v0.4.0 - golang.org/x/tools v0.16.0 + golang.org/x/crypto v0.28.0 + golang.org/x/mod v0.17.0 + golang.org/x/text v0.19.0 + golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 ) @@ -56,8 +56,9 @@ require ( github.com/zeebo/assert v1.3.0 // indirect github.com/zeebo/blake3 v0.2.3 // indirect golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect - golang.org/x/sys v0.15.0 // indirect - golang.org/x/term v0.6.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.26.0 // indirect + golang.org/x/term v0.25.0 // indirect gonum.org/v1/gonum v0.6.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 2cb1deb2c9..40840eb0bb 100644 --- a/go.sum +++ b/go.sum @@ -23,8 +23,8 @@ github.com/fxamacker/cbor/v2 v2.4.1-0.20230228173756-c0c9f774e40c/go.mod h1:TA1x github.com/fxamacker/circlehash v0.3.0 h1:XKdvTtIJV9t7DDUtsf0RIpC1OcxZtPbmgIH7ekx28WA= github.com/fxamacker/circlehash v0.3.0/go.mod h1:3aq3OfVvsWtkWMb6A1owjOQFA+TLsD5FgJflnaQwtMM= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/itchyny/gojq v0.12.14 h1:6k8vVtsrhQSYgSGg827AD+PVVaB1NLXEdX+dda2oZCc= github.com/itchyny/gojq v0.12.14/go.mod h1:y1G7oO7XkcR1LPZO59KyoCRy08T3j9vDYRV0GgYSS+s= github.com/itchyny/timefmt-go v0.1.5 h1:G0INE2la8S6ru/ZI5JecgyzbbJNs5lG1RcBqa7Jm6GE= @@ -121,8 +121,8 @@ go.uber.org/goleak v1.1.10 h1:z+mqJhf6ss6BSfSM671tgKyZBFPTTJM+HLxnhPC3wu0= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU= -golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= +golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= +golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -133,8 +133,8 @@ golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= -golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -143,8 +143,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20191109021931-daa7c04131f5/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= -golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -157,20 +157,21 @@ golang.org/x/sys v0.0.0-20200918174421-af09f7315aff/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= +golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24= +golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= +golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.16.0 h1:GO788SKMRunPIBCXiQyo2AaexLstOrVhuAL5YwsckQM= -golang.org/x/tools v0.16.0/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= From 02cd8467ad86e777aea428f8ac4fc523ad23f6ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Wed, 23 Oct 2024 11:12:33 -0700 Subject: [PATCH 12/16] remove feature flags --- runtime/contract_update_validation_test.go | 49 +---------- runtime/environment.go | 12 +-- runtime/interpreter/config.go | 2 - runtime/runtime_test.go | 25 ------ runtime/sema/check_composite_declaration.go | 38 ++++---- runtime/sema/config.go | 4 - runtime/stdlib/account.go | 4 +- ..._v0.42_to_v1_contract_upgrade_validator.go | 11 --- runtime/stdlib/contract_update_validation.go | 56 +++++------- runtime/tests/checker/attachments_test.go | 86 +++---------------- 10 files changed, 55 insertions(+), 232 deletions(-) diff --git a/runtime/contract_update_validation_test.go b/runtime/contract_update_validation_test.go index ce0203ea11..8c6c11eb3c 100644 --- a/runtime/contract_update_validation_test.go +++ b/runtime/contract_update_validation_test.go @@ -3689,7 +3689,7 @@ func TestAttachmentsUpdates(t *testing.T) { t.Parallel() testWithValidators(t, - "Keep base type, v1.0.1", + "Keep base type", func(t *testing.T, config Config) { const oldCode = ` @@ -3704,34 +3704,13 @@ func TestAttachmentsUpdates(t *testing.T) { } ` - err := testDeployAndUpdateWithVersion(t, "Test", oldCode, newCode, config, "v1.0.1") - require.NoError(t, err) - }, - ) - - testWithValidators(t, - "Keep base type, v1.0.2", - func(t *testing.T, config Config) { - - const oldCode = ` - access(all) contract Test { - access(all) attachment A for AnyResource {} - } - ` - - const newCode = ` - access(all) contract Test { - access(all) attachment A for AnyResource {} - } - ` - - err := testDeployAndUpdateWithVersion(t, "Test", oldCode, newCode, config, "v1.0.2") + err := testDeployAndUpdate(t, "Test", oldCode, newCode, config) require.NoError(t, err) }, ) testWithValidators(t, - "Change base type, v1.0.1", + "Change base type", func(t *testing.T, config Config) { const oldCode = ` @@ -3746,27 +3725,7 @@ func TestAttachmentsUpdates(t *testing.T) { } ` - err := testDeployAndUpdateWithVersion(t, "Test", oldCode, newCode, config, "v1.0.1") - require.NoError(t, err) - }) - - testWithValidators(t, - "Change base type, v1.0.2", - func(t *testing.T, config Config) { - - const oldCode = ` - access(all) contract Test { - access(all) attachment A for AnyResource {} - } - ` - - const newCode = ` - access(all) contract Test { - access(all) attachment A for AnyStruct {} - } - ` - - err := testDeployAndUpdateWithVersion(t, "Test", oldCode, newCode, config, "v1.0.2") + err := testDeployAndUpdate(t, "Test", oldCode, newCode, config) var expectedErr *stdlib.TypeMismatchError require.ErrorAs(t, err, &expectedErr) diff --git a/runtime/environment.go b/runtime/environment.go index 970bb4387f..07c30cf23c 100644 --- a/runtime/environment.go +++ b/runtime/environment.go @@ -22,7 +22,6 @@ import ( "time" "go.opentelemetry.io/otel/attribute" - "golang.org/x/mod/semver" "github.com/onflow/cadence" "github.com/onflow/cadence/runtime/activations" @@ -1467,14 +1466,7 @@ func (e *interpreterEnvironment) configureVersionedFeatures() { errors.WrapPanic(func() { minimumRequiredVersion = e.runtimeInterface.MinimumRequiredVersion() }) - enableOldBehaviour := useV101Behaviour(minimumRequiredVersion) - e.CheckerConfig.AttachmentConformancesEnabled = enableOldBehaviour - e.CheckerConfig.MemberSiblingTypeOverrideEnabled = enableOldBehaviour - e.InterpreterConfig.ContractUpdateAttachmentBaseTypeChangeEnabled = enableOldBehaviour -} - -func useV101Behaviour(currentVersion string) bool { - return currentVersion == "" || - semver.Compare(currentVersion, "v1.0.1") <= 0 + // No feature flags yet + _ = minimumRequiredVersion } diff --git a/runtime/interpreter/config.go b/runtime/interpreter/config.go index f64413aef5..dc052342d1 100644 --- a/runtime/interpreter/config.go +++ b/runtime/interpreter/config.go @@ -74,8 +74,6 @@ type Config struct { LegacyContractUpgradeEnabled bool // ContractUpdateTypeRemovalEnabled specifies if type removal is enabled in contract updates ContractUpdateTypeRemovalEnabled bool - // ContractUpdateAttachmentBaseTypeChangeEnabled specifies if attachment base type change is enabled in contract updates - ContractUpdateAttachmentBaseTypeChangeEnabled bool // ValidateAccountCapabilitiesGetHandler is used to handle when a capability of an account is got. ValidateAccountCapabilitiesGetHandler ValidateAccountCapabilitiesGetHandlerFunc // ValidateAccountCapabilitiesPublishHandler is used to handle when a capability of an account is got. diff --git a/runtime/runtime_test.go b/runtime/runtime_test.go index 5a91ab61a7..c56c01d102 100644 --- a/runtime/runtime_test.go +++ b/runtime/runtime_test.go @@ -11497,8 +11497,6 @@ func TestRuntimeBuiltInFunctionConfusion(t *testing.T) { address := common.MustBytesToAddress([]byte{0x1}) - var currentVersion string - newRuntimeInterface := func() Interface { accountCodes := map[common.AddressLocation][]byte{} @@ -11526,9 +11524,6 @@ func TestRuntimeBuiltInFunctionConfusion(t *testing.T) { OnProgramLog: func(message string) { loggedMessages = append(loggedMessages, message) }, - OnMinimumRequiredVersion: func() string { - return currentVersion - }, } } @@ -11536,8 +11531,6 @@ func TestRuntimeBuiltInFunctionConfusion(t *testing.T) { nextTransactionLocation := NewTransactionLocationGenerator() - // Deploy contract without check enabled - err := runtime.ExecuteTransaction( Script{ Source: DeploymentTransaction( @@ -11550,24 +11543,6 @@ func TestRuntimeBuiltInFunctionConfusion(t *testing.T) { Location: nextTransactionLocation(), }, ) - require.NoError(t, err) - - // Deploy contract with check enabled - - currentVersion = "v1.0.2" - - err = runtime.ExecuteTransaction( - Script{ - Source: DeploymentTransaction( - "Foo", - []byte(contract), - ), - }, - Context{ - Interface: newRuntimeInterface(), - Location: nextTransactionLocation(), - }, - ) RequireError(t, err) var redeclarationError *sema.RedeclarationError diff --git a/runtime/sema/check_composite_declaration.go b/runtime/sema/check_composite_declaration.go index 75b8c3a8d6..0128333e90 100644 --- a/runtime/sema/check_composite_declaration.go +++ b/runtime/sema/check_composite_declaration.go @@ -687,29 +687,23 @@ func (checker *Checker) declareCompositeType(declaration ast.CompositeLikeDeclar case common.CompositeKindAttachment: - if checker.Config.AttachmentConformancesEnabled { - compositeType.ExplicitInterfaceConformances = - checker.explicitInterfaceConformances(declaration, compositeType) + // Attachments may not conform to interfaces - } else { - // Attachments may not conform to interfaces + conformanceList := declaration.ConformanceList() + conformanceCount := len(conformanceList) + if conformanceCount > 0 { + firstConformance := conformanceList[0] + lastConformance := conformanceList[conformanceCount-1] - conformanceList := declaration.ConformanceList() - conformanceCount := len(conformanceList) - if conformanceCount > 0 { - firstConformance := conformanceList[0] - lastConformance := conformanceList[conformanceCount-1] - - checker.report( - &InvalidAttachmentConformancesError{ - Range: ast.NewRange( - checker.memoryGauge, - firstConformance.StartPosition(), - lastConformance.EndPosition(checker.memoryGauge), - ), - }, - ) - } + checker.report( + &InvalidAttachmentConformancesError{ + Range: ast.NewRange( + checker.memoryGauge, + firstConformance.StartPosition(), + lastConformance.EndPosition(checker.memoryGauge), + ), + }, + ) } default: @@ -1748,7 +1742,7 @@ func (checker *Checker) defaultMembersAndOrigins( } } - if nestedTypes != nil && !checker.Config.MemberSiblingTypeOverrideEnabled { + if nestedTypes != nil { if _, ok := nestedTypes.Get(name); ok { // TODO: provide previous position checker.report( diff --git a/runtime/sema/config.go b/runtime/sema/config.go index c8e72c695e..06f6e9ce95 100644 --- a/runtime/sema/config.go +++ b/runtime/sema/config.go @@ -55,8 +55,4 @@ type Config struct { AllowStaticDeclarations bool // AttachmentsEnabled determines if attachments are enabled AttachmentsEnabled bool - // AttachmentConformancesEnabled determines if attachment conformances are enabled - AttachmentConformancesEnabled bool - // MemberSiblingTypeOverrideEnabled determines if declaring members checks for sibling type declarations - MemberSiblingTypeOverrideEnabled bool } diff --git a/runtime/stdlib/account.go b/runtime/stdlib/account.go index 235dc29e6f..14f20a18d3 100644 --- a/runtime/stdlib/account.go +++ b/runtime/stdlib/account.go @@ -1679,7 +1679,6 @@ func changeAccountContracts( memoryGauge := invocation.Interpreter.SharedState.Config.MemoryGauge legacyUpgradeEnabled := invocation.Interpreter.SharedState.Config.LegacyContractUpgradeEnabled contractUpdateTypeRemovalEnabled := invocation.Interpreter.SharedState.Config.ContractUpdateTypeRemovalEnabled - contractUpdateAttachmentBaseTypeChangeEnabled := invocation.Interpreter.SharedState.Config.ContractUpdateAttachmentBaseTypeChangeEnabled var oldProgram *ast.Program @@ -1733,8 +1732,7 @@ func changeAccountContracts( } validator = validator. - WithTypeRemovalEnabled(contractUpdateTypeRemovalEnabled). - WithAttachmentBaseTypeChangeEnabled(contractUpdateAttachmentBaseTypeChangeEnabled) + WithTypeRemovalEnabled(contractUpdateTypeRemovalEnabled) err = validator.Validate() handleContractUpdateError(err, newCode) diff --git a/runtime/stdlib/cadence_v0.42_to_v1_contract_upgrade_validator.go b/runtime/stdlib/cadence_v0.42_to_v1_contract_upgrade_validator.go index d3fc96209b..838c8ecdc3 100644 --- a/runtime/stdlib/cadence_v0.42_to_v1_contract_upgrade_validator.go +++ b/runtime/stdlib/cadence_v0.42_to_v1_contract_upgrade_validator.go @@ -89,17 +89,6 @@ func (validator *CadenceV042ToV1ContractUpdateValidator) WithTypeRemovalEnabled( return validator } -func (validator *CadenceV042ToV1ContractUpdateValidator) isAttachmentBaseTypeChangeEnabled() bool { - return validator.underlyingUpdateValidator.isAttachmentBaseTypeChangeEnabled() -} - -func (validator *CadenceV042ToV1ContractUpdateValidator) WithAttachmentBaseTypeChangeEnabled( - enabled bool, -) UpdateValidator { - validator.underlyingUpdateValidator.WithAttachmentBaseTypeChangeEnabled(enabled) - return validator -} - func (validator *CadenceV042ToV1ContractUpdateValidator) getCurrentDeclaration() ast.Declaration { return validator.underlyingUpdateValidator.getCurrentDeclaration() } diff --git a/runtime/stdlib/contract_update_validation.go b/runtime/stdlib/contract_update_validation.go index 0113ab439c..00cbad8076 100644 --- a/runtime/stdlib/contract_update_validation.go +++ b/runtime/stdlib/contract_update_validation.go @@ -53,9 +53,6 @@ type UpdateValidator interface { isTypeRemovalEnabled() bool WithTypeRemovalEnabled(enabled bool) UpdateValidator - - isAttachmentBaseTypeChangeEnabled() bool - WithAttachmentBaseTypeChangeEnabled(enabled bool) UpdateValidator } type checkConformanceFunc func( @@ -66,16 +63,15 @@ type checkConformanceFunc func( type ContractUpdateValidator struct { *TypeComparator - location common.Location - contractName string - oldProgram *ast.Program - newProgram *ast.Program - currentDecl ast.Declaration - importLocations map[ast.Identifier]common.Location - accountContractNamesProvider AccountContractNamesProvider - errors []error - typeRemovalEnabled bool - attachmentBaseTypeChangeEnabled bool + location common.Location + contractName string + oldProgram *ast.Program + newProgram *ast.Program + currentDecl ast.Declaration + importLocations map[ast.Identifier]common.Location + accountContractNamesProvider AccountContractNamesProvider + errors []error + typeRemovalEnabled bool } // ContractUpdateValidator should implement ast.TypeEqualityChecker @@ -112,15 +108,6 @@ func (validator *ContractUpdateValidator) WithTypeRemovalEnabled(enabled bool) U return validator } -func (validator *ContractUpdateValidator) isAttachmentBaseTypeChangeEnabled() bool { - return validator.attachmentBaseTypeChangeEnabled -} - -func (validator *ContractUpdateValidator) WithAttachmentBaseTypeChangeEnabled(enabled bool) UpdateValidator { - validator.attachmentBaseTypeChangeEnabled = enabled - return validator -} - func (validator *ContractUpdateValidator) getCurrentDeclaration() ast.Declaration { return validator.currentDecl } @@ -322,21 +309,18 @@ func checkDeclarationUpdatability( } } - if !validator.isAttachmentBaseTypeChangeEnabled() { - - // Check if the base type of the attachment has changed. - if oldAttachment, ok := oldDeclaration.(*ast.AttachmentDeclaration); ok && - oldAttachment.DeclarationKind() == common.DeclarationKindAttachment { + // Check if the base type of the attachment has changed. + if oldAttachment, ok := oldDeclaration.(*ast.AttachmentDeclaration); ok && + oldAttachment.DeclarationKind() == common.DeclarationKindAttachment { - // NOTE: no need to check declaration kinds match, already checked above - if newAttachment, ok := newDeclaration.(*ast.AttachmentDeclaration); ok { - err := typeComparator.CheckNominalTypeEquality( - oldAttachment.BaseType, - newAttachment.BaseType, - ) - if err != nil { - validator.report(err) - } + // NOTE: no need to check declaration kinds match, already checked above + if newAttachment, ok := newDeclaration.(*ast.AttachmentDeclaration); ok { + err := typeComparator.CheckNominalTypeEquality( + oldAttachment.BaseType, + newAttachment.BaseType, + ) + if err != nil { + validator.report(err) } } } diff --git a/runtime/tests/checker/attachments_test.go b/runtime/tests/checker/attachments_test.go index 6a890e0124..b1d6c7f646 100644 --- a/runtime/tests/checker/attachments_test.go +++ b/runtime/tests/checker/attachments_test.go @@ -623,96 +623,34 @@ func TestCheckInvalidAttachmentConformance(t *testing.T) { t.Parallel() - t.Run("struct, enabled", func(t *testing.T) { - - t.Parallel() - - _, err := ParseAndCheckWithOptions(t, - ` - struct S {} - - struct interface SI {} - - attachment Test for S: SI {} - `, - ParseAndCheckOptions{ - Config: &sema.Config{ - AttachmentsEnabled: true, - AttachmentConformancesEnabled: true, - }, - }, - ) - - require.NoError(t, err) - }) - - t.Run("struct, disabled", func(t *testing.T) { + t.Run("struct", func(t *testing.T) { t.Parallel() - _, err := ParseAndCheckWithOptions(t, - ` - struct S {} + _, err := ParseAndCheck(t, ` + struct S {} - struct interface SI {} + struct interface SI {} - attachment Test for S: SI {} - `, - ParseAndCheckOptions{ - Config: &sema.Config{ - AttachmentsEnabled: true, - AttachmentConformancesEnabled: false, - }, - }, - ) + attachment Test for S: SI {} + `) errs := RequireCheckerErrors(t, err, 1) assert.IsType(t, &sema.InvalidAttachmentConformancesError{}, errs[0]) }) - t.Run("resource, enabled", func(t *testing.T) { - - t.Parallel() - - _, err := ParseAndCheckWithOptions(t, - ` - resource R {} - - resource interface RI {} - - attachment Test for R: RI {} - `, - ParseAndCheckOptions{ - Config: &sema.Config{ - AttachmentsEnabled: true, - AttachmentConformancesEnabled: true, - }, - }, - ) - - require.NoError(t, err) - }) - - t.Run("resource, disabled", func(t *testing.T) { + t.Run("resource", func(t *testing.T) { t.Parallel() - _, err := ParseAndCheckWithOptions(t, - ` - resource R {} + _, err := ParseAndCheck(t, ` + resource R {} - resource interface RI {} + resource interface RI {} - attachment Test for R: RI {} - `, - ParseAndCheckOptions{ - Config: &sema.Config{ - AttachmentsEnabled: true, - AttachmentConformancesEnabled: false, - }, - }, - ) + attachment Test for R: RI {} + `) errs := RequireCheckerErrors(t, err, 1) From e996077a4d5d57a4526ea98b5a5521e0715d6810 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Fri, 25 Oct 2024 16:15:00 -0700 Subject: [PATCH 13/16] add error return value to MinimumRequiredVersion interface function --- runtime/contract_update_validation_test.go | 4 ++-- runtime/empty.go | 2 +- runtime/environment.go | 10 ++++++++-- runtime/interface.go | 2 +- runtime/tests/runtime_utils/testinterface.go | 6 +++--- 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/runtime/contract_update_validation_test.go b/runtime/contract_update_validation_test.go index 8c6c11eb3c..2a1cd279a8 100644 --- a/runtime/contract_update_validation_test.go +++ b/runtime/contract_update_validation_test.go @@ -116,8 +116,8 @@ func newContractDeploymentTransactorWithVersion(t *testing.T, config Config, ver events = append(events, event) return nil }, - OnMinimumRequiredVersion: func() string { - return version + OnMinimumRequiredVersion: func() (string, error) { + return version, nil }, } diff --git a/runtime/empty.go b/runtime/empty.go index 89991e0539..4e9c2b58b5 100644 --- a/runtime/empty.go +++ b/runtime/empty.go @@ -261,6 +261,6 @@ func (EmptyRuntimeInterface) ValidateAccountCapabilitiesPublish( panic("unexpected call to ValidateAccountCapabilitiesPublish") } -func (EmptyRuntimeInterface) MinimumRequiredVersion() string { +func (EmptyRuntimeInterface) MinimumRequiredVersion() (string, error) { panic("unexpected call to MinimumRequiredVersion") } diff --git a/runtime/environment.go b/runtime/environment.go index 07c30cf23c..f2607eb5bd 100644 --- a/runtime/environment.go +++ b/runtime/environment.go @@ -1462,10 +1462,16 @@ func (e *interpreterEnvironment) newValidateAccountCapabilitiesPublishHandler() } func (e *interpreterEnvironment) configureVersionedFeatures() { - var minimumRequiredVersion string + var ( + minimumRequiredVersion string + err error + ) errors.WrapPanic(func() { - minimumRequiredVersion = e.runtimeInterface.MinimumRequiredVersion() + minimumRequiredVersion, err = e.runtimeInterface.MinimumRequiredVersion() }) + if err != nil { + panic(err) + } // No feature flags yet _ = minimumRequiredVersion diff --git a/runtime/interface.go b/runtime/interface.go index f93ae5100a..d5bcad7b7c 100644 --- a/runtime/interface.go +++ b/runtime/interface.go @@ -162,7 +162,7 @@ type Interface interface { capabilityBorrowType *interpreter.ReferenceStaticType, ) (bool, error) - MinimumRequiredVersion() string + MinimumRequiredVersion() (string, error) } type MeterInterface interface { diff --git a/runtime/tests/runtime_utils/testinterface.go b/runtime/tests/runtime_utils/testinterface.go index 6bf9fbc1d5..b3ff850e03 100644 --- a/runtime/tests/runtime_utils/testinterface.go +++ b/runtime/tests/runtime_utils/testinterface.go @@ -137,7 +137,7 @@ type TestRuntimeInterface struct { path interpreter.PathValue, capabilityBorrowType *interpreter.ReferenceStaticType, ) (bool, error) - OnMinimumRequiredVersion func() string + OnMinimumRequiredVersion func() (string, error) lastUUID uint64 accountIDs map[common.Address]uint64 @@ -671,9 +671,9 @@ func (i *TestRuntimeInterface) ValidateAccountCapabilitiesPublish( ) } -func (i *TestRuntimeInterface) MinimumRequiredVersion() string { +func (i *TestRuntimeInterface) MinimumRequiredVersion() (string, error) { if i.OnMinimumRequiredVersion == nil { - return "" + return "", nil } return i.OnMinimumRequiredVersion() } From ee9735518ea0c0fbfd2b0fb01294c42bcfd815c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Mon, 28 Oct 2024 08:15:07 -0700 Subject: [PATCH 14/16] make EmptyRuntimeInterface.MinimumRequiredVersion a no-op --- runtime/empty.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/empty.go b/runtime/empty.go index 4e9c2b58b5..19c6f089e4 100644 --- a/runtime/empty.go +++ b/runtime/empty.go @@ -262,5 +262,5 @@ func (EmptyRuntimeInterface) ValidateAccountCapabilitiesPublish( } func (EmptyRuntimeInterface) MinimumRequiredVersion() (string, error) { - panic("unexpected call to MinimumRequiredVersion") + return "", nil } From bc01ae190d6124c4903b9f3234cec70da18f9fd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Mon, 28 Oct 2024 08:19:02 -0700 Subject: [PATCH 15/16] return a valid semver --- runtime/empty.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/empty.go b/runtime/empty.go index 19c6f089e4..8aedf0a7fe 100644 --- a/runtime/empty.go +++ b/runtime/empty.go @@ -262,5 +262,5 @@ func (EmptyRuntimeInterface) ValidateAccountCapabilitiesPublish( } func (EmptyRuntimeInterface) MinimumRequiredVersion() (string, error) { - return "", nil + return "0.0.0", nil } From 2c239a7166456c4eb8668b0258f67d4cf2fc72fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Wed, 30 Oct 2024 09:45:42 -0700 Subject: [PATCH 16/16] go mod tidy --- tools/compatibility-check/go.mod | 10 +- tools/compatibility-check/go.sum | 219 ++++++++++++++++++++++++------- 2 files changed, 175 insertions(+), 54 deletions(-) diff --git a/tools/compatibility-check/go.mod b/tools/compatibility-check/go.mod index 44484aee7a..628bfdc184 100644 --- a/tools/compatibility-check/go.mod +++ b/tools/compatibility-check/go.mod @@ -4,6 +4,8 @@ go 1.22 require ( github.com/onflow/cadence v1.1.1-0.20241018202510-7f1b6fbc57c2 + github.com/onflow/flow-core-contracts/lib/go/contracts v1.4.0 + github.com/onflow/flow-go v0.38.0-preview.0.0.20241018215103-774056466e36 github.com/rs/zerolog v1.29.0 github.com/stretchr/testify v1.9.0 ) @@ -43,11 +45,9 @@ require ( github.com/multiformats/go-varint v0.0.7 // indirect github.com/onflow/atree v0.8.0 // indirect github.com/onflow/crypto v0.25.2 // indirect - github.com/onflow/flow-core-contracts/lib/go/contracts v1.4.0 // indirect github.com/onflow/flow-core-contracts/lib/go/templates v1.3.3-0.20241017220455-79fdc6c8ba53 // indirect github.com/onflow/flow-ft/lib/go/contracts v1.0.1 // indirect github.com/onflow/flow-ft/lib/go/templates v1.0.1 // indirect - github.com/onflow/flow-go v0.38.0-preview.0.0.20241018215103-774056466e36 // indirect github.com/onflow/flow-go-sdk v1.1.0 // indirect github.com/onflow/flow-nft/lib/go/contracts v1.2.2 // indirect github.com/onflow/flow-nft/lib/go/templates v1.2.1 // indirect @@ -75,10 +75,10 @@ require ( github.com/x448/float16 v0.8.4 // indirect github.com/zeebo/blake3 v0.2.3 // indirect go.opentelemetry.io/otel v1.24.0 // indirect - golang.org/x/crypto v0.26.0 // indirect + golang.org/x/crypto v0.28.0 // indirect golang.org/x/exp v0.0.0-20240119083558-1b970713d09a // indirect - golang.org/x/sys v0.23.0 // indirect - golang.org/x/text v0.17.0 // indirect + golang.org/x/sys v0.26.0 // indirect + golang.org/x/text v0.19.0 // indirect golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect gonum.org/v1/gonum v0.14.0 // indirect google.golang.org/appengine v1.6.8 // indirect diff --git a/tools/compatibility-check/go.sum b/tools/compatibility-check/go.sum index ee2555e618..3c453fa707 100644 --- a/tools/compatibility-check/go.sum +++ b/tools/compatibility-check/go.sum @@ -38,6 +38,8 @@ cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3f dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= +github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/SaveTheRbtz/mph v0.1.1-0.20240117162131-4166ec7869bc h1:DCHzPQOcU/7gwDTWbFQZc5qHMPS1g0xTO56k8NXsv9M= github.com/SaveTheRbtz/mph v0.1.1-0.20240117162131-4166ec7869bc/go.mod h1:LJM5a3zcIJ/8TmZwlUczvROEJT8ntOdhdG9jjcR1B0I= @@ -46,14 +48,19 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/bits-and-blooms/bitset v1.5.0 h1:NpE8frKRLGHIcEzkR+gZhiioW1+WbYV6fKwD6ZIpQT8= -github.com/bits-and-blooms/bitset v1.5.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bits-and-blooms/bitset v1.10.0 h1:ePXTeiPEazB5+opbv5fr8umg2R/1NlzgDsyepwsSr88= github.com/bits-and-blooms/bitset v1.10.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ= github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= +github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= @@ -61,6 +68,18 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cockroachdb/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= +github.com/cockroachdb/errors v1.11.3/go.mod h1:m4UIW4CDjx+R5cybPsNrRbreomiFqt8o1h1wUVazSd8= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce h1:giXvy4KSc/6g/esnpM7Geqxka4WSqI1SZc7sMJFd3y4= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/pebble v1.1.1 h1:XnKU22oiCLy2Xn8vp1re67cXg4SAasg/WDt1NtcRFaw= +github.com/cockroachdb/pebble v1.1.1/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= @@ -68,7 +87,6 @@ github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= @@ -79,8 +97,18 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= +github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= +github.com/dgraph-io/ristretto v0.1.0 h1:Jv3CGQHp9OjuMBSne1485aDpUkTKEcUqF+jm/LuerPI= +github.com/dgraph-io/ristretto v0.1.0/go.mod h1:fux0lOrBhrVCJd3lcTHsIJhq1T2rokOu6v9Vcb3Q9ug= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA= +github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/ef-ds/deque v1.0.4 h1:iFAZNmveMT9WERAkqLJ+oaABF9AcVQ5AjXem/hroniI= +github.com/ef-ds/deque v1.0.4/go.mod h1:gXDnTC3yqvBcHbq2lcExjtAcVrOnJCbMcZXmuj8Z4tg= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -89,6 +117,8 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.m github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/ethereum/go-ethereum v1.13.10 h1:Ppdil79nN+Vc+mXfge0AuUgmKWuVv4eMqzoIVSdqZek= github.com/ethereum/go-ethereum v1.13.10/go.mod h1:sc48XYQxCzH3fG9BcrXCOOgQk2JfZzNAmIKnceogzsA= +github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= +github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= @@ -96,6 +126,8 @@ github.com/fxamacker/cbor/v2 v2.4.1-0.20230228173756-c0c9f774e40c h1:5tm/Wbs9d9r github.com/fxamacker/cbor/v2 v2.4.1-0.20230228173756-c0c9f774e40c/go.mod h1:TA1xS00nchWmaBnEIxPSE5oHLuJBAVvqrtAnWBwBCVo= github.com/fxamacker/circlehash v0.3.0 h1:XKdvTtIJV9t7DDUtsf0RIpC1OcxZtPbmgIH7ekx28WA= github.com/fxamacker/circlehash v0.3.0/go.mod h1:3aq3OfVvsWtkWMb6A1owjOQFA+TLsD5FgJflnaQwtMM= +github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= +github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -103,11 +135,19 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2 github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68= +github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -137,6 +177,8 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= +github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -149,8 +191,8 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -166,39 +208,77 @@ github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.0 h1:bM6ZAFZmc/wPFaRDi0d5L7hGEZEx/2u+Tmr2evNHDiI= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 h1:Wqo399gCIufwto+VfwCSvsnfGpF/w5E9CNxSwbpD6No= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0/go.mod h1:qmOFXW2epJhM0qSnUUYpldc7gVz2KMQwJ/QYCDIa7XU= +github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= +github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/holiman/uint256 v1.3.0 h1:4wdcm/tnd0xXdu7iS3ruNvxkWwrb4aeBQv19ayYn8F4= github.com/holiman/uint256 v1.3.0/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= +github.com/huandu/go-clone v1.6.0 h1:HMo5uvg4wgfiy5FoGOqlFLQED/VGRm2D9Pi8g1FXPGc= +github.com/huandu/go-clone v1.6.0/go.mod h1:ReGivhG6op3GYr+UY3lS6mxjKp7MIGTknuU5TbTVaXE= +github.com/huandu/go-clone/generic v1.7.2 h1:47pQphxs1Xc9cVADjOHN+Bm5D0hNagwH9UXErbxgVKA= +github.com/huandu/go-clone/generic v1.7.2/go.mod h1:xgd9ZebcMsBWWcBx5mVMCoqMX24gLWr5lQicr+nVXNs= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/ipfs/bbloom v0.0.4 h1:Gi+8EGJ2y5qiD5FbsbpX/TMNcJw8gSqr7eyjHa4Fhvs= +github.com/ipfs/bbloom v0.0.4/go.mod h1:cS9YprKXpoZ9lT0n/Mw/a6/aFV6DTjTLYHeA+gyqMG0= +github.com/ipfs/boxo v0.17.1-0.20240131173518-89bceff34bf1 h1:5H/HYvdmbxp09+sAvdqJzyrWoyCS6OroeW9Ym06Tb+0= +github.com/ipfs/boxo v0.17.1-0.20240131173518-89bceff34bf1/go.mod h1:pIZgTWdm3k3pLF9Uq6MB8JEcW07UDwNJjlXW1HELW80= +github.com/ipfs/go-block-format v0.2.0 h1:ZqrkxBA2ICbDRbK8KJs/u0O3dlp6gmAuuXUJNiW1Ycs= +github.com/ipfs/go-block-format v0.2.0/go.mod h1:+jpL11nFx5A/SPpsoBn6Bzkra/zaArfSmsknbPMYgzM= github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s= github.com/ipfs/go-cid v0.4.1/go.mod h1:uQHwDeX4c6CtyrFwdqyhpNcxVewur1M7l7fNU7LKwZk= +github.com/ipfs/go-datastore v0.6.0 h1:JKyz+Gvz1QEZw0LsX1IBn+JFCJQH4SJVFtM4uWU0Myk= +github.com/ipfs/go-datastore v0.6.0/go.mod h1:rt5M3nNbSO/8q1t4LNkLyUwRs8HupMeN/8O4Vn9YAT8= +github.com/ipfs/go-ipfs-util v0.0.3 h1:2RFdGez6bu2ZlZdI+rWfIdbQb1KudQp3VGwPtdNCmE0= +github.com/ipfs/go-ipfs-util v0.0.3/go.mod h1:LHzG1a0Ig4G+iZ26UUOMjHd+lfM84LZCrn17xAKWBvs= +github.com/ipfs/go-ipld-format v0.6.0 h1:VEJlA2kQ3LqFSIm5Vu6eIlSxD/Ze90xtc4Meten1F5U= +github.com/ipfs/go-ipld-format v0.6.0/go.mod h1:g4QVMTn3marU3qXchwjpKPKgJv+zF+OlaKMyhJ4LHPg= +github.com/ipfs/go-log v1.0.5 h1:2dOuUCB1Z7uoczMWgAyDck5JLb72zHzrMnGnCNNbvY8= +github.com/ipfs/go-log/v2 v2.5.1 h1:1XdUzF7048prq4aBjDQQ4SL5RxftpRGdXhNRwKSAlcY= +github.com/ipfs/go-log/v2 v2.5.1/go.mod h1:prSpmC1Gpllc9UYWxDiZDreBYw7zp4Iqp1kOLU9U5UI= +github.com/ipfs/go-metrics-interface v0.0.1 h1:j+cpbjYvu4R8zbleSs36gvB7jR+wsL2fGD6n0jO4kdg= +github.com/ipfs/go-metrics-interface v0.0.1/go.mod h1:6s6euYU4zowdslK0GKHmqaIZ3j/b/tL7HTWtJ4VPgWY= +github.com/jbenet/goprocess v0.1.4 h1:DRGOFReOMqqDNXwW70QkacFW0YN9QnwLV0Vqk+3oU0o= +github.com/jbenet/goprocess v0.1.4/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZlqdZVfqY4= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 h1:uC1QfSlInpQF+M0ao65imhwqKnz3Q2z/d8PWZRMQvDM= +github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= github.com/k0kubun/pp v3.0.1+incompatible h1:3tqvf7QgUnZ5tXO6pNAZlrvHgl6DvifjDrd9g2S9Z40= github.com/k0kubun/pp v3.0.1+incompatible/go.mod h1:GWse8YhT0p8pT4ir3ZgBbfZild3tgzSScAn6HmfYukg= github.com/kevinburke/go-bindata v3.24.0+incompatible h1:qajFA3D0pH94OTLU4zcCCKCDgR+Zr2cZK/RPJHDdFoY= github.com/kevinburke/go-bindata v3.24.0+incompatible/go.mod h1:/pEEZ72flUW2p0yi30bslSp9YqD9pysLxunQDdb2CPM= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= +github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/klauspost/cpuid/v2 v2.0.12/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c= -github.com/klauspost/cpuid/v2 v2.2.0 h1:4ZexSFt8agMNzNisrsilL6RClWDC5YJnLHNIfTy4iuc= -github.com/klauspost/cpuid/v2 v2.2.0/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc= github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -213,6 +293,14 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= +github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= +github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= +github.com/libp2p/go-libp2p v0.32.2 h1:s8GYN4YJzgUoyeYNPdW7JZeZ5Ee31iNaIBfGYMAY4FQ= +github.com/libp2p/go-libp2p v0.32.2/go.mod h1:E0LKe+diV/ZVJVnOJby8VC5xzHF0660osg71skcxJvk= +github.com/libp2p/go-libp2p-pubsub v0.10.0 h1:wS0S5FlISavMaAbxyQn3dxMOe2eegMfswM471RuHJwA= +github.com/libp2p/go-libp2p-pubsub v0.10.0/go.mod h1:1OxbaT/pFRO5h+Dpze8hdHQ63R0ke55XTs6b6NwLLkw= +github.com/libp2p/go-msgio v0.3.0 h1:mf3Z8B1xcFN314sWX+2vOTShIE0Mmn2TXn3YCUQGNj0= +github.com/libp2p/go-msgio v0.3.0/go.mod h1:nyRM819GmVaF9LX3l03RMh10QdOroF++NBbxAb0mmDM= github.com/logrusorgru/aurora/v4 v4.0.0 h1:sRjfPpun/63iADiSvGGjgA1cAYegEWMPCJdUpJYn9JA= github.com/logrusorgru/aurora/v4 v4.0.0/go.mod h1:lP0iIa2nrnT/qoFXcOZSrZQpJ1o6n2CUf/hyHi2Q4ZQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= @@ -226,6 +314,9 @@ github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= +github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= +github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -238,21 +329,24 @@ github.com/multiformats/go-base32 v0.1.0 h1:pVx9xoSPqEIQG8o+UbAe7DNi51oej1NtK+aG github.com/multiformats/go-base32 v0.1.0/go.mod h1:Kj3tFY6zNr+ABYMqeUNeGvkIC/UYgtWibDcT0rExnbI= github.com/multiformats/go-base36 v0.2.0 h1:lFsAbNOGeKtuKozrtBsAkSVhv1p9D0/qedU9rQyccr0= github.com/multiformats/go-base36 v0.2.0/go.mod h1:qvnKE++v+2MWCfePClUEjE78Z7P2a1UV0xHgWc0hkp4= +github.com/multiformats/go-multiaddr v0.12.2 h1:9G9sTY/wCYajKa9lyfWPmpZAwe6oV+Wb1zcmMS1HG24= +github.com/multiformats/go-multiaddr v0.12.2/go.mod h1:GKyaTYjZRdcUhyOetrxTk9z0cW+jA/YrnqTOvKgi44M= github.com/multiformats/go-multibase v0.2.0 h1:isdYCVLvksgWlMW9OZRYJEa9pZETFivncJHmHnnd87g= github.com/multiformats/go-multibase v0.2.0/go.mod h1:bFBZX4lKCA/2lyOFSAoKH5SS6oPyjtnzK/XTFDPkNuk= +github.com/multiformats/go-multicodec v0.9.0 h1:pb/dlPnzee/Sxv/j4PmkDRxCOi3hXTz3IbPKOXWJkmg= +github.com/multiformats/go-multicodec v0.9.0/go.mod h1:L3QTQvMIaVBkXOXXtVmYE+LI16i14xuaojr/H7Ai54k= github.com/multiformats/go-multihash v0.2.3 h1:7Lyc8XfX/IY2jWb/gI7JP+o7JEq9hOa7BFvVU9RSh+U= github.com/multiformats/go-multihash v0.2.3/go.mod h1:dXgKXCXjBzdscBLk9JkjINiEsCKRVch90MdaGiKsvSM= +github.com/multiformats/go-multistream v0.5.0 h1:5htLSLl7lvJk3xx3qT/8Zm9J4K8vEOf/QGkvOGQAyiE= +github.com/multiformats/go-multistream v0.5.0/go.mod h1:n6tMZiwiP2wUsR8DgfDWw1dydlEqV3l6N3/GBsX6ILA= github.com/multiformats/go-varint v0.0.7 h1:sWSGR+f/eu5ABZA2ZpYKBILXTTs9JWpdEM/nEGOHFS8= github.com/multiformats/go-varint v0.0.7/go.mod h1:r8PUYw/fD/SjBCiKOoDlGF6QawOELpZAu9eioSos/OU= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/onflow/atree v0.8.0 h1:qg5c6J1gVDNObughpEeWm8oxqhPGdEyGrda121GM4u0= github.com/onflow/atree v0.8.0/go.mod h1:yccR+LR7xc1Jdic0mrjocbHvUD7lnVvg8/Ct1AA5zBo= -github.com/onflow/crypto v0.25.0 h1:BeWbLsh3ZD13Ej+Uky6kg1PL1ZIVBDVX+2MVBNwqddg= -github.com/onflow/crypto v0.25.0/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI= github.com/onflow/crypto v0.25.2 h1:GjHunqVt+vPcdqhxxhAXiMIF3YiLX7gTuTR5O+VG2ns= github.com/onflow/crypto v0.25.2/go.mod h1:fY7eLqUdMKV8EGOw301unP8h7PvLVy8/6gVR++/g0BY= -github.com/onflow/flow v0.3.4 h1:FXUWVdYB90f/rjNcY0Owo30gL790tiYff9Pb/sycXYE= github.com/onflow/flow-core-contracts/lib/go/contracts v1.4.0 h1:R86HaOuk6vpuECZnriEUE7bw9inC2AtdSn8lL/iwQLQ= github.com/onflow/flow-core-contracts/lib/go/contracts v1.4.0/go.mod h1:9asTBnB6Tw2UlVVtQKyS/egYv3xr4zVlJnJ75z1dfac= github.com/onflow/flow-core-contracts/lib/go/templates v1.3.3-0.20241017220455-79fdc6c8ba53 h1:swCMX7k//QjHatAZ3URX4GhfUWmLc6S/tmaw2mS/0ZU= @@ -273,9 +367,13 @@ github.com/onflow/flow/protobuf/go/flow v0.4.7 h1:iP6DFx4wZ3ETORsyeqzHu7neFT3d1C github.com/onflow/flow/protobuf/go/flow v0.4.7/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk= github.com/onflow/go-ethereum v1.14.7 h1:gg3awYqI02e3AypRdpJKEvNTJ6kz/OhAqRti0h54Wlc= github.com/onflow/go-ethereum v1.14.7/go.mod h1:zV14QLrXyYu5ucvcwHUA0r6UaqveqbXaehAVQJlSW+I= +github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 h1:onHthvaw9LFnH4t2DcNVpwGmV9E1BkGknEliJkfwQj0= +github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58/go.mod h1:DXv8WO4yhMYhSNPKjeNKa5WY9YCIEBRbNzFFPJbWO6Y= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml/v2 v2.0.6 h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvIwycIU= github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= +github.com/pierrec/lz4 v2.6.1+incompatible h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9FV9ix19jjM= +github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -285,13 +383,21 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= +github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= +github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= +github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= +github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= +github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/psiemens/sconfig v0.1.0 h1:xfWqW+TRpih7mXZIqKYTmpRhlZLQ1kbxV8EjllPv76s= github.com/psiemens/sconfig v0.1.0/go.mod h1:+MLKqdledP/8G3rOBpknbLh0IclCf4WneJUtS26JB2U= @@ -299,18 +405,19 @@ github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= -github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.26.1 h1:/ihwxqH+4z8UxyI70wM1z9yCvkWcfz/a3mj48k/Zngc= -github.com/rs/zerolog v1.26.1/go.mod h1:/wSSJWX7lVrsOwlbyTRSOJvqRlc+WjWlfes+CiJ+tmc= +github.com/rs/zerolog v1.29.0 h1:Zes4hju04hjbvkVkOhdl2HpZa+0PmVwigmo8XoORE5w= github.com/rs/zerolog v1.29.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= +github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/slok/go-http-metrics v0.10.0 h1:rh0LaYEKza5eaYRGDXujKrOln57nHBi4TtVhmNEpbgM= +github.com/slok/go-http-metrics v0.10.0/go.mod h1:lFqdaS4kWMfUKCSukjC47PdCeTk+hXDUVm8kLHRqJ38= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= @@ -372,7 +479,6 @@ github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zeebo/assert v1.1.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ= @@ -388,15 +494,31 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opentelemetry.io/otel v1.8.0 h1:zcvBFizPbpa1q7FehvFiHbQwGzmPILebO0tyqIR5Djg= -go.opentelemetry.io/otel v1.8.0/go.mod h1:2pkj+iMj0o03Y+cW6/m8Y4WkRdYN3AvCXCnzRMp9yvM= go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 h1:cl5P5/GIfFh4t6xyruOgJP5QiA1pw4fYYdv6nc6CBWw= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0/go.mod h1:zgBdWWAu7oEEMC06MMKc5NLbA/1YDXV1sMpSqEeLQLg= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0 h1:tIqheXEFWAZ7O8A7m+J0aPTmpJN3YQ7qetUAdkkkKpk= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0/go.mod h1:nUeKExfxAQVbiVFn32YXpXZZHZ61Cc3s3Rn1pDBGAb0= +go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= +go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= +go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw= +go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg= +go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= +go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= +go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= +go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/goleak v1.1.10 h1:z+mqJhf6ss6BSfSM671tgKyZBFPTTJM+HLxnhPC3wu0= -go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= +go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= +go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= +go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -406,12 +528,9 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20211215165025-cf75a172585e/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU= -golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= -golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= -golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= +golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= +golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -422,8 +541,6 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc h1:ao2WRsKSzW6KuUY9IWPwWahcHCgR0s52IfwutMfEbdM= -golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= golang.org/x/exp v0.0.0-20240119083558-1b970713d09a h1:Q8/wZp0KX97QFTc2ywcOE0YRjZPVIx+MXInMzdvQqcA= golang.org/x/exp v0.0.0-20240119083558-1b970713d09a/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= @@ -437,7 +554,6 @@ golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= @@ -450,10 +566,9 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= -golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -488,9 +603,10 @@ golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -510,8 +626,9 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -552,19 +669,15 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= -golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -576,10 +689,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= -golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= +golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -631,19 +742,15 @@ golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.16.0 h1:GO788SKMRunPIBCXiQyo2AaexLstOrVhuAL5YwsckQM= -golang.org/x/tools v0.16.0/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU= golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= -gonum.org/v1/gonum v0.6.1 h1:/LSrTrgZtpbXyAR6+0e152SROCkJJSh7goYWVmdPFGc= -gonum.org/v1/gonum v0.6.1/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= gonum.org/v1/gonum v0.14.0 h1:2NiG67LD1tEH0D7kM+ps2V+fXmsAnpUeec7n8tcr4S0= gonum.org/v1/gonum v0.14.0/go.mod h1:AoWeoz0becf9QMWtE8iWXNXc27fK4fNeHNf/oMejGfU= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= @@ -710,6 +817,11 @@ google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de h1:cZGRis4/ot9uVm639a+rHCUaG0JJHEsdyzSQTMX+suY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -727,6 +839,8 @@ google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -742,9 +856,10 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= @@ -752,9 +867,13 @@ gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= +gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -764,6 +883,8 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= lukechampine.com/blake3 v1.3.0 h1:sJ3XhFINmHSrYCgl958hscfIa3bw8x4DqMP3u1YvoYE= lukechampine.com/blake3 v1.3.0/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k= +pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= +pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=