Skip to content
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

go client: Failed to fetch transaction: invalid transaction v, r, s values #2500

Open
ebadiere opened this issue May 16, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@ebadiere
Copy link
Collaborator

Description

When trying to unmarshal transaction 0x65486c84522a4f581aeaf5d2b17dc7993c76c916e78158f375d0c89d625e4979 from mainnet using the ethereum go client, it fails with Failed to fetch transaction: invalid transaction v, r, s values

Steps to reproduce

  1. Running the relay locally, but pointed to mainnet, can help debug the issue, so it's recommended as step 1.
  2. Build and run the snippet of go below:
package main

import (
	"context"
	"fmt"
	"log"

	"github.com/ethereum/go-ethereum/common"
	"github.com/ethereum/go-ethereum/ethclient"
)

func main() {
	// Connect to your Ethereum node
	client, err := ethclient.Dial("http://localhost:7546")
	if err != nil {
		log.Fatalf("Failed to connect to the Ethereum client: %v", err)
	}
	defer client.Close()

	// Fetch the chain ID
    chainId, err := client.ChainID(context.Background())
    if err != nil {
        log.Fatalf("Failed to fetch chain ID: %v", err)
    }

    fmt.Printf("Connected to network with Chain ID: %s\n", chainId.String())
	// Transaction hash to fetch
	txHash := common.HexToHash("0x65486c84522a4f581aeaf5d2b17dc7993c76c916e78158f375d0c89d625e4979")

	// Fetch the transaction
	tx, isPending, err := client.TransactionByHash(context.Background(), txHash)
	if err != nil {
		log.Fatalf("Failed to fetch transaction: %v", err)
	}

	fmt.Printf("Transaction: %+v\n", tx)
	fmt.Printf("Is Pending: %v\n", isPending)
}

To build and run:

mkdir getTransaction
cd getTransaction
go init .

Save the above snippet in a file called main.go

Run:

go build .
go run .

Additional context

No response

Hedera network

mainnet

Version

v0.47.0

Operating system

macOS

@ebadiere ebadiere added the bug Something isn't working label May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

1 participant