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

Overwritten transactions are not removed #57

Closed
monokh opened this issue Feb 2, 2018 · 2 comments
Closed

Overwritten transactions are not removed #57

monokh opened this issue Feb 2, 2018 · 2 comments

Comments

@monokh
Copy link
Contributor

monokh commented Feb 2, 2018

  • Version: 0.1.0b15
  • Python: 3.5
  • OS: all

What was wrong?

When submitting a transaction that overwrites another transaction, the original transaction is not removed and calls to getTransaction() still return the old transaction instead of null.

In geth, the transaction would be removed and returned as None from getTransaction().

Example:

tester = EthereumTester(auto_mine_transactions=False)

web3 = Web3(EthereumTesterProvider(tester))

original_tx = web3.eth.sendTransaction({
    'from': '...',
    'to': '...',
    'value': 1,
    'gas': 23500,
    'gasPrice': 10,
    'nonce': 0
})

print(web3.eth.getTransaction(original_tx))

replacement_tx = web3.eth.sendTransaction({
    'from': '...',
    'to': '...',
    'value': 2,
    'gas': 23500,
    'gasPrice': 20,
    'nonce': 0
})

print(web3.eth.getTransaction(replacement_tx))
print(web3.eth.getTransaction(original_tx))  # Should be null but still returns transaction

How can it be fixed?

Unsure whether this is a backend problem or not but i imagine there needs to be some tx pool managing functionality added.

@pipermerriam
Copy link
Member

I'd consider this a bug that should be fixed such that it conforms to the geth behavior.

@carver
Copy link
Contributor

carver commented Feb 23, 2018

Fixed by #60

@carver carver closed this as completed Feb 23, 2018
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

3 participants