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

Unable to modify gas_limit parameter on sign-tx request #83

Open
leoslr opened this issue Oct 9, 2020 · 1 comment
Open

Unable to modify gas_limit parameter on sign-tx request #83

leoslr opened this issue Oct 9, 2020 · 1 comment

Comments

@leoslr
Copy link

leoslr commented Oct 9, 2020

Hello,

Brief Description

When trying to sign a transaction with any accounts, I'm unable to modify the gas_limit parameter of the transaction.
It always takes the default value which is 21000.

Detailed Description

I've tried to send sign-tx request by using the cli with :

vault write vault-ethereum/accounts/bob/sign-tx to="0xd569541AD6ED57539af62a91B405b68dB5958BA0" encoding="hex" data="6057361d0000000000000000000000000000000000000000000000000000000000000145" gas_limit="10000000"

(Before trying to make this request I sent ether to the corresponding account).
The response I get :

Key                   Value
---                   -----
amount                0
from                  0x27dF8d028f7DF8B58D70A70F575FfFdCc05Fa733
gas_limit             21000
gas_price             1000000000
nonce                 0
signed_transaction    0xf88780843b9aca0082520894d569541ad6ed57539af62a91b405b68db5958ba080a46057361d00000000000000000000000000000000000000000000000000000000000001451ba0abb4298ac728b8c8a5f81c4326a8776eb4759d29a865ad0f7f4bb0fa70d09df7a0707fe28950e64b98032ffba28fcc4863bd58ef4ab531bc2aefd826aac1c0b83b
to                    0xd569541AD6ED57539af62a91B405b68dB5958BA0
transaction_hash      0x3055d5a9341f3e02e2b53f25fd9e993c1a2f87a9ef8c543e188e6e65c2492d13

I've tried several gas_limit values including hexadecimal ones. It's value always stays at 21000.
I'm able to change all of the other parameters' value.

I decoded the signed transaction and and indeed the transaction is crafted with the wrong gas_limit parameter (21000).
I've also tried to make request with curl but the result is the same.

This makes it impossible to send transactions containing data that trigger smart contract functions : the gas_limit is too low.
When sending the transaction to any RPC endpoint we get the following error :

Intrinsic gas too low

Your Environment

OS : Debian 10.
Vault and Vault-ethereum are running inside a docker container.
Version of Vault utilisée : 1.5.3
Version of Vault-Ethereum plugin : 0.3.0
Vault ethereum config :

Key                Value
---                -----
bound_cidr_list    <nil>
chain_id           4
exclusions         <nil>
inclusions         <nil>
rpc_url            https://rinkeby.infura.io/v3/MY_INFURA_ENDPOINT
@acalleja3
Copy link

acalleja3 commented Jan 18, 2021

Hello,

change the function getData in "path_accounts.go" like this:

func (b *PluginBackend) getData(client *ethclient.Client, fromAddress common.Address, data *framework.FieldData) (*TransactionParams, error) {
	transactionParams, err := b.getBaseData(client, fromAddress, data, "to")
	if err != nil {
		return nil, err
	}
	var gasLimitIn *big.Int
	gasLimitIn = util.ValidNumber(data.Get("gas_limit").(string))
	gasLimit := gasLimitIn.Uint64()
	return &TransactionParams{
		Nonce:    transactionParams.Nonce,
		Address:  transactionParams.Address,
		Amount:   transactionParams.Amount,
		GasPrice: transactionParams.GasPrice,
		GasLimit: gasLimit,
	}, nil
}

GetDefaultOrZero is changed to Get

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

2 participants