zksync-sdk / zksync2-go

zksync2-go is a geth library adapted to work with the zkSync Era.
Apache License 2.0
87 stars 36 forks source link

unknown field ExcessDataGas in struct literal #27

Closed Mixnosha closed 7 months ago

Mixnosha commented 9 months ago

go.mod

module l2

go 1.21.3

require (
    github.com/ethereum/go-ethereum v1.13.8
    github.com/zksync-sdk/zksync2-go v0.3.2
)

Code from example

package main

import (
    "github.com/zksync-sdk/zksync2-go/clients"
)

func main() {
    ZkSyncEraProvider := "https://testnet.era.zksync.dev"
    ZkSyncEraWSProvider := "ws://testnet.era.zksync.dev:3051"

    // Connect to zkSync network
    client, err := clients.Dial(ZkSyncEraProvider)
    if err != nil {
        panic(err)
    }
    defer client.Close()

    // Connect to zkSync network using Web Socket
    wsClient, err := clients.Dial(ZkSyncEraWSProvider)
    if err != nil {
        panic(err)
    }
    defer wsClient.Close()

}

Command go run main.go

Error

# github.com/zksync-sdk/zksync2-go/clients
../../../../go/pkg/mod/github.com/zksync-sdk/zksync2-go@v0.3.2/clients/base_client.go:743:4: unknown field ExcessDataGas in struct literal of type "github.com/ethereum/go-ethereum/core/types".Header
danijelTxFusion commented 8 months ago

@Mixnosha Version 0.3.2 does not work with geth: 1.13, you need to downgrade to 1.12.0. We are currently migrating to the latest version of geth, so the new version should be released soon. The go.mod should look like this:

module l2

go 1.21.3

require github.com/zksync-sdk/zksync2-go v0.3.2

require (
        github.com/StackExchange/wmi v1.2.1 // indirect
        github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
        github.com/deckarep/golang-set/v2 v2.1.0 // indirect
        github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
        github.com/ethereum/go-ethereum v1.12.0 // indirect
        github.com/fsnotify/fsnotify v1.6.0 // indirect
        github.com/go-ole/go-ole v1.2.5 // indirect
        github.com/go-stack/stack v1.8.1 // indirect
        github.com/google/uuid v1.3.0 // indirect
        github.com/gorilla/websocket v1.4.2 // indirect
        github.com/holiman/uint256 v1.2.4 // indirect
        github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect
        github.com/stretchr/testify v1.8.2 // indirect
        github.com/tklauser/go-sysconf v0.3.12 // indirect
        github.com/tklauser/numcpus v0.6.1 // indirect
        golang.org/x/crypto v0.17.0 // indirect
        golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect
        golang.org/x/sync v0.5.0 // indirect
        golang.org/x/sys v0.15.0 // indirect
        gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
)

Please notice the github.com/ethereum/go-ethereum v1.12.0 // indirect in required section.

danijelTxFusion commented 8 months ago

Also WebSocket connections are not allowed on testnet.

Meteriox commented 8 months ago

Also WebSocket connections are not allowed on testnet.

which means i cannot subscribe to contract events via ws connections?

danijelTxFusion commented 8 months ago

Also WebSocket connections are not allowed on testnet.

which means i cannot subscribe to contract events via ws connections?

Correct. On testnet node is overloaded with traffic and listening on events is not possible.

smickovskid commented 7 months ago

Hey @danijelTxFusion do we have an ETA on this ? Can we perhaps use some branch that is in development ?

danijelTxFusion commented 7 months ago

It should be done in 2 days.

danijelTxFusion commented 7 months ago

Fixed in v0.4.0.