Skip to content

Update flow-go version with EVM Pectra hard-fork enabled #821

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions emulator/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -610,13 +610,11 @@ func configureFVM(blockchain *Blockchain, conf config, blocks *blocks) (*fvm.Vir
cadenceLogger := conf.Logger.Hook(CadenceHook{MainLogger: &conf.ServerLogger}).Level(zerolog.DebugLevel)

runtimeConfig := runtime.Config{
Debugger: blockchain.debugger,
LegacyContractUpgradeEnabled: conf.LegacyContractUpgradeEnabled,
CoverageReport: conf.CoverageReport,
StorageFormatV2Enabled: true,
Debugger: blockchain.debugger,
CoverageReport: conf.CoverageReport,
}
coverageReportedRuntime := &CoverageReportedRuntime{
Runtime: runtime.NewInterpreterRuntime(runtimeConfig),
Runtime: runtime.NewRuntime(runtimeConfig),
CoverageReport: conf.CoverageReport,
Environment: runtime.NewBaseInterpreterEnvironment(runtimeConfig),
}
Expand Down
12 changes: 6 additions & 6 deletions emulator/computation_report.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ type ProcedureReport struct {
ComputationUsed uint64 `json:"computation"`
// To get the computation from the intensities map, see:
// https://github.com/onflow/flow-go/blob/master/fvm/meter/computation_meter.go#L32-L39
Intensities map[string]uint `json:"intensities"`
MemoryEstimate uint64 `json:"memory"`
Code string `json:"source"`
Arguments []string `json:"arguments"`
Intensities map[string]uint64 `json:"intensities"`
MemoryEstimate uint64 `json:"memory"`
Code string `json:"source"`
Arguments []string `json:"arguments"`
}

type ComputationReport struct {
Expand Down Expand Up @@ -82,8 +82,8 @@ func (cr *ComputationReport) ReportTransaction(
// to a human-friendly string value.
func transformIntensities(
intensities meter.MeteredComputationIntensities,
) map[string]uint {
result := make(map[string]uint)
) map[string]uint64 {
result := make(map[string]uint64)

for kind, value := range intensities {
switch kind {
Expand Down
4 changes: 2 additions & 2 deletions emulator/computation_report_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func TestComputationReportingForScript(t *testing.T) {
scriptProfile := computationReport.Scripts[scriptResult.ScriptID.String()]
assert.GreaterOrEqual(t, scriptProfile.ComputationUsed, uint64(2*2+3+5+7+11))

expectedIntensities := map[string]uint{
expectedIntensities := map[string]uint64{
"FunctionInvocation": 2,
"GetAccountContractCode": 1,
"GetCode": 1,
Expand Down Expand Up @@ -151,7 +151,7 @@ func TestComputationReportingForTransaction(t *testing.T) {
txProfile := computationReport.Transactions[txResult.TransactionID.String()]
assert.GreaterOrEqual(t, txProfile.ComputationUsed, uint64(1))

expectedIntensities := map[string]uint{
expectedIntensities := map[string]uint64{
"CreateCompositeValue": 2,
"CreateDictionaryValue": 1,
"EmitEvent": 73,
Expand Down
6 changes: 3 additions & 3 deletions emulator/transaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2017,7 +2017,7 @@ func TestSubmitTransactionWithCustomLogger(t *testing.T) {
assert.Greater(t, meter.ComputationUsed, 0)
assert.Greater(t, meter.MemoryEstimate, 0)
assert.Greater(t, len(meter.ComputationIntensities), 0)
assert.Greater(t, len(meter.MemoryIntensities), 0)
assert.Greater(t, len(meter.MemoryAmounts), 0)

}

Expand All @@ -2026,12 +2026,12 @@ type Meter struct {
ComputationUsed int `json:"computationUsed"`
MemoryEstimate int `json:"memoryEstimate"`
ComputationIntensities MeteredComputationIntensities `json:"computationIntensities"`
MemoryIntensities MeteredMemoryIntensities `json:"memoryIntensities"`
MemoryAmounts MemoryAmounts `json:"memoryAmounts"`
}

type MeteredComputationIntensities map[common.ComputationKind]uint

type MeteredMemoryIntensities map[common.MemoryKind]uint
type MemoryAmounts map[common.MemoryKind]uint

func IncrementHelper(
t *testing.T,
Expand Down
93 changes: 49 additions & 44 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module github.com/onflow/flow-emulator

go 1.23
go 1.23.7

toolchain go1.23.4
toolchain go1.23.8

require (
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2
Expand All @@ -14,23 +14,23 @@ require (
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
github.com/improbable-eng/grpc-web v0.15.0
github.com/logrusorgru/aurora v2.0.3+incompatible
github.com/onflow/cadence v1.3.4
github.com/onflow/crypto v0.25.2
github.com/onflow/flow-core-contracts/lib/go/templates v1.6.0
github.com/onflow/flow-go v0.40.1
github.com/onflow/flow-go-sdk v1.3.3
github.com/onflow/flow-nft/lib/go/contracts v1.2.3
github.com/onflow/cadence v1.6.0
github.com/onflow/crypto v0.25.3
github.com/onflow/flow-core-contracts/lib/go/templates v1.6.1
github.com/onflow/flow-go v0.42.0
github.com/onflow/flow-go-sdk v1.6.0
github.com/onflow/flow-nft/lib/go/contracts v1.2.4
github.com/onflow/flow/protobuf/go/flow v0.4.10
github.com/prometheus/client_golang v1.20.5
github.com/psiemens/graceland v1.0.0
github.com/psiemens/sconfig v0.1.0
github.com/rs/zerolog v1.29.0
github.com/spf13/cobra v1.8.0
github.com/spf13/cobra v1.8.1
github.com/stretchr/testify v1.10.0
go.uber.org/atomic v1.11.0
go.uber.org/mock v0.5.0
golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67
google.golang.org/grpc v1.67.1
google.golang.org/grpc v1.72.0
)

require github.com/SaveTheRbtz/mph v0.1.1-0.20240117162131-4166ec7869bc // indirect
Expand All @@ -41,23 +41,23 @@ require (
github.com/StackExchange/wmi v1.2.1 // indirect
github.com/VictoriaMetrics/fastcache v1.12.2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.10.0 // indirect
github.com/bits-and-blooms/bitset v1.17.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cockroachdb/errors v1.11.3 // indirect
github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/pebble v1.1.1 // indirect
github.com/cockroachdb/pebble v1.1.2 // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/consensys/bavard v0.1.13 // indirect
github.com/consensys/gnark-crypto v0.12.1 // indirect
github.com/consensys/bavard v0.1.22 // indirect
github.com/consensys/gnark-crypto v0.14.0 // indirect
github.com/coreos/go-semver v0.3.0 // indirect
github.com/crate-crypto/go-ipa v0.0.0-20240223125850-b1e8a79f509c // indirect
github.com/crate-crypto/go-kzg-4844 v1.0.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a // indirect
github.com/crate-crypto/go-kzg-4844 v1.1.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect
github.com/deckarep/golang-set/v2 v2.6.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
Expand All @@ -71,10 +71,9 @@ require (
github.com/ef-ds/deque v1.0.4 // indirect
github.com/ethereum/c-kzg-4844 v1.0.0 // indirect
github.com/ethereum/go-ethereum v1.13.10 // indirect
github.com/ethereum/go-verkle v0.1.1-0.20240306133620-7d920df305f0 // indirect
github.com/ethereum/go-verkle v0.2.2 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/fxamacker/circlehash v0.3.0 // indirect
github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff // indirect
github.com/getsentry/sentry-go v0.27.0 // indirect
github.com/go-kit/kit v0.12.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
Expand All @@ -84,7 +83,7 @@ require (
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/gofrs/flock v0.8.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v1.2.2 // indirect
github.com/golang/glog v1.2.4 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/google/uuid v1.6.0 // indirect
Expand All @@ -97,7 +96,7 @@ require (
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/holiman/bloomfilter/v2 v2.0.3 // indirect
github.com/holiman/uint256 v1.3.0 // indirect
github.com/holiman/uint256 v1.3.2 // indirect
github.com/huandu/go-clone v1.6.0 // indirect
github.com/huandu/go-clone/generic v1.7.2 // indirect
github.com/huin/goupnp v1.3.0 // indirect
Expand Down Expand Up @@ -146,20 +145,25 @@ require (
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/onflow/atree v0.10.0 // indirect
github.com/onflow/bridged-usdc/lib/go/contracts v1.0.0 // indirect
github.com/onflow/flow-core-contracts/lib/go/contracts v1.6.0 // indirect
github.com/onflow/flow-core-contracts/lib/go/contracts v1.6.1 // indirect
github.com/onflow/flow-evm-bridge v0.1.0 // 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-nft/lib/go/templates v1.2.1 // indirect
github.com/onflow/go-ethereum v1.14.7 // indirect
github.com/onflow/go-ethereum v1.15.10 // indirect
github.com/onflow/nft-storefront/lib/go/contracts v1.0.0 // indirect
github.com/onflow/sdks v0.6.0-preview.1 // indirect
github.com/onflow/wal v1.0.2 // indirect
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
github.com/pelletier/go-toml/v2 v2.2.1 // indirect
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
github.com/pion/dtls/v2 v2.2.12 // indirect
github.com/pion/logging v0.2.2 // indirect
github.com/pion/stun/v2 v2.0.0 // indirect
github.com/pion/transport/v2 v2.2.10 // indirect
github.com/pion/transport/v3 v3.0.7 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.61.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
Expand All @@ -178,43 +182,42 @@ require (
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.15.0 // indirect
github.com/status-im/keycard-go v0.2.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
github.com/supranational/blst v0.3.11 // indirect
github.com/supranational/blst v0.3.14 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
github.com/texttheater/golang-levenshtein/levenshtein v0.0.0-20200805054039-cae8b0eaed6c // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/turbolent/prettier v0.0.0-20220320183459-661cc755135d // indirect
github.com/tyler-smith/go-bip39 v1.1.0 // indirect
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
github.com/vmihailenco/msgpack/v4 v4.3.11 // indirect
github.com/vmihailenco/tagparser v0.1.1 // indirect
github.com/wlynxg/anet v0.0.5 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/zeebo/blake3 v0.2.4 // indirect
go.opentelemetry.io/otel v1.31.0 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/otel v1.35.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.31.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.31.0 // indirect
go.opentelemetry.io/otel/metric v1.31.0 // indirect
go.opentelemetry.io/otel/sdk v1.31.0 // indirect
go.opentelemetry.io/otel/trace v1.31.0 // indirect
go.opentelemetry.io/otel/metric v1.35.0 // indirect
go.opentelemetry.io/otel/sdk v1.35.0 // indirect
go.opentelemetry.io/otel/trace v1.35.0 // indirect
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/crypto v0.31.0 // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/term v0.27.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/crypto v0.37.0 // indirect
golang.org/x/net v0.39.0 // indirect
golang.org/x/sync v0.14.0 // indirect
golang.org/x/sys v0.32.0 // indirect
golang.org/x/term v0.31.0 // indirect
golang.org/x/text v0.24.0 // indirect
golang.org/x/time v0.11.0 // indirect
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
gonum.org/v1/gonum v0.15.0 // indirect
gonum.org/v1/gonum v0.16.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9 // indirect
google.golang.org/protobuf v1.36.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250414145226-207652e42e2e // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250428153025-10db94c68c34 // indirect
google.golang.org/protobuf v1.36.6 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
lukechampine.com/blake3 v1.4.0 // indirect
Expand All @@ -225,3 +228,5 @@ require (
nhooyr.io/websocket v1.8.7 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
)

replace github.com/hashicorp/golang-lru/v2 => github.com/fxamacker/golang-lru/v2 v2.0.0-20250430153159-6f72f038a30f
Loading
Loading