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

Local accounts and transactions for the txPool #1049

Open
mjfh opened this issue Apr 8, 2022 · 0 comments
Open

Local accounts and transactions for the txPool #1049

mjfh opened this issue Apr 8, 2022 · 0 comments
Labels
docs Issues relating to documentation EL enhancement New feature or request

Comments

@mjfh
Copy link
Contributor

mjfh commented Apr 8, 2022

Here is some idea of the logic employed by the transaction pool. maybe somebody has an opinion about that.

The txPool can prioritise transactions for packing. This is done by logically tagging or labelling accounts or transactions as local.

Local accounts

Tagging accounts as local is done persistently. It is active up until the tag is removed again from the account. All current and future valid transactions from the local account are preferred when it comes to packing. For example, the address passed to the TxPoolRef constructor is automatically tagged local (which must be explicitely removed if undesirable.)

This is basically the way Geth looks at local accounts.

Local transactions

Individual transactions can also sort of be tagged local. The idea was inspired by some OpenEthereum command line options document (scroll down to Local transactions.) This is not a full description how they work in relation to other transactions.

For consistency here, valid transactions tagged local also imply all transactions with nonces smaller than the current one local for a given account. These transaction tags are temporary and will be flushed out regularly when the packed block was accepted (more specifically when the internal head was ajusted using smartHead().)

The temporary nature of local transactions has consequences. Consider a successful packing session with local transactions. The session has been committed using smartHead() and the notion of locality gets flushed out. Then roll back to the previous state (using smartHead() again.) All the transactions from the block chain will be copied back (from the block chain) and available, again but the there is no such thing as a local transaction, anymore.

.. any comments?

@mjfh mjfh added enhancement New feature or request docs Issues relating to documentation labels Apr 8, 2022
@jangko jangko added the EL label Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Issues relating to documentation EL enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants