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

RPC sendTransaction (without specified from address): could not unlock sender account #490

Closed
jorisbontje opened this issue Mar 16, 2015 · 5 comments

Comments

@jorisbontje
Copy link

Running ethereum develop 0b8f66e with:

ethereum -mine=true -rpc=true -rpcport=8080 --unlock=0x0b30af04d96bfb672de96d3b25e30b4eb9ff3ed0:bla

When calling web.eth.sendTransaction without specifying a from address:

{"jsonrpc":"2.0","method":"eth_sendTransaction","params":[{"gas":"0x30d40","value":"0x4563918244f40000","to":"0xa4a32f03650491ab977b6923864be50efc242a20","data":"0x26638a380000000000000000000000000000000000000000000000000000000000000005","gasPrice":"0x0"}],"id":22}

This results in the following RPC error:

{
    "id": 22,
    "jsonrpc": "2.0",
    "error": {
        "code": -32603,
        "message": "could not unlock sender account"
    }
}

Error in CLI console:

err: could not unlock sender account

I would expect that sendTransaction would have access to the unlocked account 0x0b30af04d96bfb672de96d3b25e30b4eb9ff3ed0 and use that by default. Or that the from address for sendTransaction would be mandatory.

@fjl
Copy link
Contributor

fjl commented Mar 16, 2015

from is mandatory.

@fjl
Copy link
Contributor

fjl commented Mar 16, 2015

We need to change that in the RPC API so it returns the right error.

@ethers
Copy link
Member

ethers commented Mar 16, 2015

I specify the "from":

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_sendTransaction","params":[{"from":"0x32ad27653e4df5d81728d16d8e251fee34f53d30", "gas":"0x30d40","value":"0x4563918244f40000","to":"0xa4a32f03650491ab977b6923864be50efc242a20","data":"0x26638a380000000000000000000000000000000000000000000000000000000000000005","gasPrice":"0x0"}],"id":1}' http://localhost:8080

I get an address that is too long:

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": "0x2d5525aebc243630e165d4f44c4cfb77e69b673e832fa77be2745d917ee00121"
}                                                                              

Is it a separate issue?

@tgerring
Copy link
Contributor

It looks like the result of that call is returning a transaction hash.(

go-ethereum/xeth/xeth.go

Lines 373 to 376 in fe819f3

if types.IsContractAddr(to) {
return toHex(core.AddressFromMessage(tx)), nil
}
return toHex(tx.Hash()), nil
)

Types is currently being refactored, so the underlying code this uses will change and I expect at least a slight refactor of RPC to use the updated functions will result in simpler and "more correct" RPC calls

@ethers
Copy link
Member

ethers commented Mar 17, 2015

thanks @tgerring tx hash is actually helpful (will even become more common than creating contracts)

ngtuna added a commit to ngtuna/tomochain that referenced this issue Apr 11, 2019
tony-ricciardi pushed a commit to tony-ricciardi/go-ethereum that referenced this issue Jan 20, 2022
* contract_comm/currency/currency.go

* fixed the txn price-sorted min-heap

* merge master (ethereum#490)

* Add precompiles to access validator set (ethereum#441)

* set max gas to double of the charged gas for the 'intrinsic' smart contract calls (ethereum#472)

* set max gas to double of the charged gas for the 'intrinsic' evm operations

* addressed PR comments

* addressed pr comment

* Adds Prepared Certificates to ensure Istanbul liveness (ethereum#366)

* Check message address against signature (ethereum#477)

* Check signing validator's address matches msg address

* Add comments about use of sig data in tests

* Try fix Circle build test failures

* Try fix Circle build test failures, take 2
tony-ricciardi pushed a commit to tony-ricciardi/go-ethereum that referenced this issue Jan 20, 2022
* Log on ValidatorElections

* merge master (ethereum#496)

* Check message address against signature (ethereum#477)

* Check signing validator's address matches msg address

* Add comments about use of sig data in tests

* Try fix Circle build test failures

* Try fix Circle build test failures, take 2

* tx price heap fix (ethereum#471)

* contract_comm/currency/currency.go

* fixed the txn price-sorted min-heap

* merge master (ethereum#490)

* Add precompiles to access validator set (ethereum#441)

* set max gas to double of the charged gas for the 'intrinsic' smart contract calls (ethereum#472)

* set max gas to double of the charged gas for the 'intrinsic' evm operations

* addressed PR comments

* addressed pr comment

* Adds Prepared Certificates to ensure Istanbul liveness (ethereum#366)

* Check message address against signature (ethereum#477)

* Check signing validator's address matches msg address

* Add comments about use of sig data in tests

* Try fix Circle build test failures

* Try fix Circle build test failures, take 2

* added new option --use-in-memory-discovery-table (ethereum#479)

* added new option --use-in-memory-discovery-table

* merge master (ethereum#489)

* Adds Prepared Certificates to ensure Istanbul liveness (ethereum#366)

* Check message address against signature (ethereum#477)

* Check signing validator's address matches msg address

* Add comments about use of sig data in tests

* Try fix Circle build test failures

* Try fix Circle build test failures, take 2

* Allow v4/v5 on a bootnode simultaneously, allow mobile to use discv5 (ethereum#454)

* changes for isolating celo networks

* changes to get unit tests working

* changes to add salt in the discovery packets

* removed checking for the ip address when handling a reply

* added ping-ip-from-packet option to bootnode

* for handling expected replies, don't filter on expected sender ip address if --pingIPFromPacket is used

* Add v4 flag

* Add unhandled and quicken docker builds

* Add salt & logs

* Add v4 flag

* Add PeerDiscovery to mobile node config

* Remove logs

* Remove hardcoded bootnodes

* Add salt & turn on discv5

* Delete hardcoded eth bootnodes

* Make Discoveryv5 configurable

* Lint

* Add comment to bootnode v4/v5 handling

* Change PeerDiscovery -> NoDiscovery

* Remove mobile geth no discovery

* Reduce istanbul default timeout, cap exp backoff (ethereum#475)

* Reduce istanbul default timeout, cap exp backoff

* Ensure round 0 timeout factors in block period

* Sanitize logs (ethereum#495)

* Change registry lookup and infrastructure lookup error logs to debug level

* Sanitize logs regarding registry deployment

* Change empty abi logging and comment

* Lower log level from error to warning for potentially outdated istanbul messages

* Change back to an error message

* Add input length checks for precompiled contracts (ethereum#476)

* add input length checks

* check exact input length. add a new error for input length. check input in a few more places

* add tests that verify the input-length checks for contracts that don't require an evm instance

* fix formatting

* add comments to explain input length checks

* run the formatter

* e2e transfer test was failing because it passes in a transaction options object, making the input larger than 96 bytes

* e2e tests have revealed that our precompiled contracts need to be tolerant of inputs that are longer than the bytes that are actually read
tanishqjasoria pushed a commit to tanishqjasoria/go-ethereum that referenced this issue Oct 31, 2023
* docs(ccc): add more logs for skipping msg

* bump version

* format codes

* improve
s1na pushed a commit to s1na/go-ethereum that referenced this issue Dec 2, 2024
implement EIP-234: add blockHash param for eth_getLogs
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

No branches or pull requests

4 participants