question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing `account_exists` implementation prevents execution of sharding transactions

See original GitHub issue

What is wrong?

Executing sharding transactions currently does not work with the FlatTrieBackend as it doesn’t implement account_exists.

Note that it is not related to account creation transactions per se (as I assumed earlier), normal transactions are affected in the same way.

How can it be fixed

Either implement account_exists or don’t use it. It is called in some SELFDESTUCT (e.g. https://github.com/ethereum/py-evm/blob/362266c323c83a851f7dff0a2a59796abaa3f318/evm/logic/system.py#L64) and some CALL (e.g. https://github.com/ethereum/py-evm/blob/362266c323c83a851f7dff0a2a59796abaa3f318/evm/logic/call.py#L287) opcodes. It changes from fork to fork though and I’m not sure if this is still needed, especially as at least one one motivation seems to have been the dust clean up in Spurious Dragon. Also, it seems to be used for gas calculation only which will be different with stateless clients anyway.

It is also called indirectly via touch_account for every message, but this can unproblematically be replaced by setting nonce/balance/code to zero unless they are non-zero.

Implementing account_exists is probably the easier solution (with check_if_branch_exist in py-trie), but I don’t like this as much. But that’s mainly due to me not seeing why such a function would be necessary.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
jannikluhncommented, Jan 19, 2018

I don’t think the account methods need to be removed, rather changed slightly:

  • account_is_empty should not check the nonce
  • account_exists should be kept as is (raising a NotImplementedError)
  • touch_account should not rely on account_exists, but have the same effect (just set nonce/balance/code to zero unless they are set already)
1reaction
jannikluhncommented, Jan 18, 2018

Look over the logic of CALL, would the nonce part become very different with the account abstraction model?

I was under the impression that contract nonces would be removed altogether. ~In its current implementation CREATE2 uses the contract nonce though~, so I’m not sure about this. But I don’t think it matters a lot, the only thing that would be affected is the definition of an “empty account” (code/balance/nonce = 0 to code/balance = 0).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ethereum sharding: A beginner's guide to blockchain sharding
Sharding is a data management technique that can potentially allow Ethereum to handle up to 100000 TPS.
Read more >
EIP-4844: Shard Blob Transactions
This EIP provides a stop-gap solution until that point by implementing the transaction format that would be used in sharding, ...
Read more >
Yggdrasil: Secure State Sharding of Transactions and Smart ...
ABSTRACT. This paper presents Yggdrasil a sharding solution for permissionless blockchains that supports both payment transactions and ...
Read more >
Understanding Database Sharding | DigitalOcean
The first difficulty that people encounter with sharding is the sheer complexity of properly implementing a sharded database architecture. If ...
Read more >
Implementing cross-shard transactions - Ethereum Research
One disadvantage of rate-limiting is that then, there are no guarantees that receipts will be received in any finite amount of time, which...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found