Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

[PAN-2850] Create a transaction pool configuration object #1615

Merged

Conversation

AbdelStark
Copy link
Contributor

PR description

Regroup txPoolMaxSize, pendingTxRetentionPeriod, txMessageKeepAliveSeconds CLI options into one TransactionPoolConfiguration object.

Fixed Issue(s)

@AbdelStark AbdelStark added enhancement New feature or request api Related to public APIs labels Jun 27, 2019
final MetricsSystem metricsSystem,
final SyncState syncState,
final int maxTransactionRetentionHours,
final Wei minTransactionGasPrice,
Copy link
Contributor

Choose a reason for hiding this comment

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

(Discussion) What about folding minTransactionGasPrice into TransactionPoolConfiguration? Or maybe the TransactionPool also gets access to MiningParams so that we don't end up duplicating data on 2 different config objects?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes it makes sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I mean the second approach where TransactionPool also gets access to MiningParams

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually the PantheonControllerBuilder passes the minTransactionPrice to the transactionPool from the MiningParams

    final TransactionPool transactionPool =
        TransactionPoolFactory.createTransactionPool(
            protocolSchedule,
            protocolContext,
            ethProtocolManager.ethContext(),
            clock,
            metricsSystem,
            syncState,
            miningParameters.getMinTransactionGasPrice(),
            transactionPoolConfiguration)

SInce it uses only one parameter from the MiningParams i don't think we need to give it access to the whole object now. What do you think ?

Copy link
Contributor

Choose a reason for hiding this comment

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

🤷‍♀ Just feels odd to have a config object and then have an additional dangling option. But there's some weirdness with all 3 options really (as is + my 2 alternative suggestions). I think I'm leaning towards passing in the MiningParams - it makes it more explicit that the transactionPool's behavior is modified by the mining configuration. But I'll leave it up to you.

@AbdelStark AbdelStark merged commit 3dcc0c4 into PegaSysEng:master Jun 27, 2019
@AbdelStark AbdelStark deleted the feature/pan-2850-tx-pool-config-object branch August 23, 2019 16:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api Related to public APIs enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants