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

Store pending transactions in relay #98

Merged
merged 10 commits into from
May 21, 2019
Merged

Store pending transactions in relay #98

merged 10 commits into from
May 21, 2019

Conversation

spalladino
Copy link
Collaborator

@spalladino spalladino commented Apr 26, 2019

Adds a new TxStore component that stores all unconfirmed transactions, with two implementations: an in-memory one and a LevelDB-backed one. Transactions are stored ordered by increasing nonce. Whenever a transactions is sent, it is added to the store.

RelayServer has now a UpdateUnconfirmedTransactions method for updating the transactions on the store. This process removes all transactions from the store that have been confirmed (ie mined at least 12 blocks ago). If the transaction with the lowest nonce is pending (ie not mined) after 5 minutes, it is resent with an increased gas price (25% extra, with a max cap), and its timestamp is reset.

This method is now invoked every minute from the RelayHTTPServer.

Fixes #77

@spalladino spalladino marked this pull request as ready for review May 9, 2019 22:17
@shahafn
Copy link
Member

shahafn commented May 13, 2019

I added netcat to the docker image since circle failed on not finding it, when you run it in run-ganache script. Please rebase and push so we can rerun the tests.

@shahafn
Copy link
Member

shahafn commented May 21, 2019

As we said, see #112

@shahafn shahafn merged commit 4d55b69 into opengsn:master May 21, 2019
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

Successfully merging this pull request may close these issues.

relay: persistent transaction management
2 participants