Skip to content

all: change TxPreEvent to TxsPreEvent#16720

Merged
karalabe merged 2 commits intoethereum:masterfrom
rjl493456442:PreTxsEvent
May 19, 2018
Merged

all: change TxPreEvent to TxsPreEvent#16720
karalabe merged 2 commits intoethereum:masterfrom
rjl493456442:PreTxsEvent

Conversation

@rjl493456442
Copy link
Copy Markdown
Member

@rjl493456442 rjl493456442 commented May 10, 2018

Currently, when a transaction is promoted, a TxPreEvent will be pushed to subscribers immediately.

While when the number of new transactions received is large, there are too many TxPreEvent will be pushed leads to txFeed lock resource contention.

So in this PR, i replace all TxPreEvent to TxsPreEvent. So that we can push a batch of new promoted txs together. It will help in these scenario:

  • Block reorganization(a bunch of transactions will be re-injected to txpool )
  • Improve transaction forwarding efficiency(Send a batch of transactions to peers instead of single one)
  • Relieving pressure on the system from websocket pending transaction subscriptions(Prevent slower socket write speeds from blocking txfeed)

Besides, in this PR, also fix a small problem.
When we apply new promoted transaction to mining block, it should sill abide original gas limit restriction instead of creating a new gas limit.

@rjl493456442 rjl493456442 changed the title WIP all: change TxPreEvent to TxsPreEvent all: change TxPreEvent to TxsPreEvent May 11, 2018
@karalabe karalabe added this to the 1.8.9 milestone May 18, 2018
Copy link
Copy Markdown
Member

@karalabe karalabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one typo

Comment thread core/tx_journal.go Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/journelled/journalled/

Comment thread core/tx_pool.go

// We've directly injected a replacement transaction, notify subsystems
go pool.txFeed.Send(TxsPreEvent{types.Transactions{tx}})
go pool.txFeed.Send(NewTxsEvent{types.Transactions{tx}})
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will it be better if we post the NewTxsEvent synchronously here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Felix started looking into the synchronous postings, so I'd rather keep that can of worms in a separate pr.

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.

3 participants