Skip to content

Repeated contract addresses when creating contract via JSON-RPC #731

@tinybike

Description

@tinybike

I'm attempting to load several different contracts onto the blockchain using eth_sendTransaction over JSON-RPC. I am encountering an unusual problem -- the contracts appear to be broadcast successfully, but the address in the result field is always the same! Here's an example:

jack@vent:~/src$ curl --data '{"jsonrpc":"2.0","method":"eth_sendTransaction","params":[{"from":"0x63524e3fe4791aefce1e932bbfb3fdf375bfad89","data":"0x603980600b6000396044567c01000000000000000000000000000000000000000000000000000000006000350463643ceff9811415603757600a60405260206040f35b505b6000f3","gas":10000000}],"id":1}' http://127.0.0.1:8545
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": "0x13aad6f5573db896e589d2fdef22da8c5033141d"
}

This particular contract is a very simple Serpent contract:

def ten():
    return(10)

The exact same address 0x13aad6f5573db896e589d2fdef22da8c5033141d is returned no matter what the contract I broadcast is.

When I restart geth, sending contracts works again (for a little while). After a bit of testing, it seems like the following error is triggering this behavior:

"error": {
    "code": -32603,
    "message": "Known transaction (c6a8cdc5)"
}

This error appears sometimes (but not always) when re-submitting a contract, which I'm assuming is a bug. For some reason, this error is followed by the unusual problem described above.

I'm running geth v0.9.9 on Ubuntu 14.04 (installed via ppa):

jack@vent:~/src$ geth version
Welcome to the FRONTIER
Geth
Version: 0.9.9
Protocol Version: 60
Network Id: 0
GO: go1.4.2
OS: linux
GOPATH=/home/jack/src/gocode
GOROOT=/usr/lib/go

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions