Skip to content

Support more argument types in InvokeContractFunctionOnContext - #4538

Merged
turbolent merged 1 commit into
v1.10from
bastian/v1.10-on-context-argument-conversion
Nov 9, 2026
Merged

turbolent merged 1 commit into
v1.10from
bastian/v1.10-on-context-argument-conversion

Conversation

@turbolent

Copy link
Copy Markdown
Member

Description

Argument conversion without an environment only handled Address arguments that are expected as account references.

Import values without a standard library handler and without a location resolver, so that e.g. primitive, path and array arguments can be passed. The importer rejects PublicKey and HashAlgorithm values when no handler is available.


  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work
  • Code follows the standards mentioned here
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

@turbolent
turbolent enabled auto-merge November 9, 2026 19:52
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

Benchstat comparison

  • Base branch: onflow:v1.10
  • Base commit: f93561b
Results

old.txtnew.txt
time/opdelta
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
ByteArrayTransfer-41.87µs ± 0%1.64µs ± 0%~(p=1.000 n=1+1)
ByteArrayValueToByteSlice-490.7ns ± 0%86.3ns ± 0%~(p=1.000 n=1+1)
ByteSliceToByteArrayValue-41.49µs ± 0%1.53µs ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/runtime goos:linux goarch:amd64
ContractFunctionInvocation-4411µs ± 0%415µs ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
EMVAddressTransfer-44.68µs ± 0%5.37µs ± 0%~(p=1.000 n=1+1)
Emit-45.39ms ± 0%5.52ms ± 0%~(p=1.000 n=1+1)
EnumTransfer-42.03µs ± 0%1.90µs ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/runtime goos:linux goarch:amd64
ExportType/composite_type-4237ns ± 0%236ns ± 0%~(p=1.000 n=1+1)
ExportType/simple_type-443.6ns ± 0%43.3ns ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
ImperativeFib-424.9µs ± 0%24.9µs ± 0%~(p=1.000 n=1+1)
InterpretRecursionFib-42.54ms ± 0%2.44ms ± 0%~(p=1.000 n=1+1)
NewInterpreter/new_interpreter-4944ns ± 0%948ns ± 0%~(p=1.000 n=1+1)
NewInterpreter/new_sub-interpreter-4334ns ± 0%334ns ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/runtime goos:linux goarch:amd64
RuntimeFungibleTokenTransferInterpreter-4678µs ± 0%675µs ± 0%~(p=1.000 n=1+1)
RuntimeResourceDictionaryValues-42.75ms ± 0%2.75ms ± 0%~(p=1.000 n=1+1)
RuntimeResourceTracking-411.0ms ± 0%11.0ms ± 0%~(p=1.000 n=1+1)
RuntimeScriptNoop-416.5µs ± 0%17.0µs ± 0%~(p=1.000 n=1+1)
RuntimeVMInvokeContractImperativeFib-446.9µs ± 0%50.3µs ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
ValueIsSubtypeOfSemaType-459.2ns ± 0%61.5ns ± 0%~(p=1.000 n=1+1)
 
alloc/opdelta
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
ByteArrayTransfer-41.20kB ± 0%1.15kB ± 0%~(p=1.000 n=1+1)
ByteArrayValueToByteSlice-432.0B ± 0%32.0B ± 0%~(all equal)
ByteSliceToByteArrayValue-4951B ± 0%969B ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/runtime goos:linux goarch:amd64
ContractFunctionInvocation-4148kB ± 0%148kB ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
EMVAddressTransfer-42.77kB ± 0%2.81kB ± 0%~(p=1.000 n=1+1)
Emit-41.70MB ± 0%1.70MB ± 0%~(p=1.000 n=1+1)
EnumTransfer-41.05kB ± 0%1.01kB ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/runtime goos:linux goarch:amd64
ExportType/composite_type-4112B ± 0%112B ± 0%~(all equal)
ExportType/simple_type-40.00B 0.00B ~(all equal)
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
ImperativeFib-48.30kB ± 0%8.30kB ± 0%~(all equal)
InterpretRecursionFib-41.17MB ± 0%1.17MB ± 0%~(p=1.000 n=1+1)
NewInterpreter/new_interpreter-41.02kB ± 0%1.02kB ± 0%~(all equal)
NewInterpreter/new_sub-interpreter-4232B ± 0%232B ± 0%~(all equal)
pkg:github.com/onflow/cadence/runtime goos:linux goarch:amd64
RuntimeFungibleTokenTransferInterpreter-4174kB ± 0%174kB ± 0%~(p=1.000 n=1+1)
RuntimeResourceDictionaryValues-41.81MB ± 0%1.81MB ± 0%~(p=1.000 n=1+1)
RuntimeResourceTracking-47.44MB ± 0%7.43MB ± 0%~(p=1.000 n=1+1)
RuntimeScriptNoop-48.18kB ± 0%8.18kB ± 0%~(p=1.000 n=1+1)
RuntimeVMInvokeContractImperativeFib-415.0kB ± 0%15.0kB ± 0%~(all equal)
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
ValueIsSubtypeOfSemaType-432.0B ± 0%32.0B ± 0%~(all equal)
 
allocs/opdelta
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
ByteArrayTransfer-48.00 ± 0%8.00 ± 0%~(all equal)
ByteArrayValueToByteSlice-41.00 ± 0%1.00 ± 0%~(all equal)
ByteSliceToByteArrayValue-46.00 ± 0%6.00 ± 0%~(all equal)
pkg:github.com/onflow/cadence/runtime goos:linux goarch:amd64
ContractFunctionInvocation-42.26k ± 0%2.26k ± 0%~(all equal)
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
EMVAddressTransfer-431.0 ± 0%31.0 ± 0%~(all equal)
Emit-442.0k ± 0%42.0k ± 0%~(all equal)
EnumTransfer-414.0 ± 0%14.0 ± 0%~(all equal)
pkg:github.com/onflow/cadence/runtime goos:linux goarch:amd64
ExportType/composite_type-42.00 ± 0%2.00 ± 0%~(all equal)
ExportType/simple_type-40.00 0.00 ~(all equal)
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
ImperativeFib-4176 ± 0%176 ± 0%~(all equal)
InterpretRecursionFib-416.5k ± 0%16.5k ± 0%~(all equal)
NewInterpreter/new_interpreter-416.0 ± 0%16.0 ± 0%~(all equal)
NewInterpreter/new_sub-interpreter-44.00 ± 0%4.00 ± 0%~(all equal)
pkg:github.com/onflow/cadence/runtime goos:linux goarch:amd64
RuntimeFungibleTokenTransferInterpreter-43.22k ± 0%3.22k ± 0%~(all equal)
RuntimeResourceDictionaryValues-436.7k ± 0%36.7k ± 0%~(all equal)
RuntimeResourceTracking-4131k ± 0%131k ± 0%~(p=1.000 n=1+1)
RuntimeScriptNoop-4117 ± 0%117 ± 0%~(all equal)
RuntimeVMInvokeContractImperativeFib-4488 ± 0%488 ± 0%~(all equal)
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
ValueIsSubtypeOfSemaType-41.00 ± 0%1.00 ± 0%~(all equal)
 

@turbolent
turbolent merged commit 05cfcc2 into v1.10 Nov 9, 2026
15 checks passed
@turbolent
turbolent deleted the bastian/v1.10-on-context-argument-conversion branch November 9, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

⌂ 换网址