Skip to content

Conversation

@luke-jr
Copy link
Member

@luke-jr luke-jr commented Jul 11, 2012

Accepts the transaction into mined blocks at a higher (or lower) priority

@jgarzik
Copy link
Contributor

jgarzik commented Jul 11, 2012

Code seems ACK-worthy.

Use cases?

@luke-jr
Copy link
Member Author

luke-jr commented Jul 11, 2012

Various people (@gmaxwell and @gavinandresen included) expressed interest in this - one example was to allow captcha-solving as an alternative to fees.

src/main.h Outdated
Copy link

Choose a reason for hiding this comment

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

Have 2 empty lines a special meaning in the code?

@gmaxwell
Copy link
Contributor

Re: Ignoring minfee: This call is by txid. If you don't like the fee, don't call it on the transaction. Ignoring minfee is the right thing to do here.

Though this should also have a fee delta, because we now prioritize above minfee txn by fee per KB. If someone is paying you behind the scenes to mine a transaction you should be able to add the amount you're being paid (or whatever) to the fee used in that calculation. e.g. prioritizetransaction .

@luke-jr
Copy link
Member Author

luke-jr commented Aug 13, 2012

Updated with suggestions. Also, is it intentional that GetMinFee with GMF_BLOCK is never used anymore?

@luke-jr luke-jr mentioned this pull request Aug 13, 2012
@BitcoinPullTester
Copy link

@sipa
Copy link
Member

sipa commented Aug 13, 2012

@luke-jr Which commit removed the call to GetMinFee with GMF_BLOCK?

@luke-jr
Copy link
Member Author

luke-jr commented Aug 13, 2012

@sipa c555400

src/main.cpp Outdated
Copy link
Member

Choose a reason for hiding this comment

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

This needs a LOCK on mempool.cs, imho. Even if it's somehow already safe because of the lock on cs_main, I'd prefer having it there, for when RPC locks get pushed down.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

@gmaxwell
Copy link
Contributor

Needs a rebase

@luke-jr
Copy link
Member Author

luke-jr commented Nov 14, 2012

rebased

src/main.h Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

Adding 16 bytes to every in-memory transaction to support a feature that will not be used by 99.9% of users seems like the wrong thing to do.

How about instead keeping a map<transaction_id, pair<priorityDelta,feeDelta> > in the memory pool class, and have prioritisetransaction add to that map?

Finally: need to check to see if the free transaction rate limiter code needs to take this into account (I assume you should be able to prioritisetransaction and then if you receive the transaction over the network it should sail through the limiter and make it into the memory pool -- or is it assumed that the transaction will get into the memory pool some other way, like a sendrawtransaction call?).

Copy link
Member Author

Choose a reason for hiding this comment

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

With the deltas stored on CTransaction, applying them to not-received ones was impractical. Obviously using a map as you suggest solves this problem too - will do that.

@luke-jr
Copy link
Member Author

luke-jr commented Apr 12, 2013

Ok, finally redid this using a map.

@gavinandresen , look good?

@jgarzik
Copy link
Contributor

jgarzik commented May 30, 2013

No objection... though I still prioritize with the 'z' :) Who the heck uses an 's'? :)

src/main.cpp Outdated
Copy link
Member

Choose a reason for hiding this comment

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

I don't like all these side-effects in a const getter function

Edit: hmm, never mind, ApplyDeltas does not actually change anything in the mempool object.

@luke-jr
Copy link
Member Author

luke-jr commented Aug 21, 2013

It occurs to me that the map should be cleaned at some point. Any opinions on when to remove a txid from it?

@gmaxwell
Copy link
Contributor

Check it when removing transactions from the mempool?

@luke-jr
Copy link
Member Author

luke-jr commented Aug 21, 2013

Probably don't want to lose priority adjustments if your block gets knocked off the main chain...

@petertodd
Copy link
Contributor

@luke-jr Set a expiry height after they get knocked off the main chain and remove them from the map after n blocks? If n=100 is reached we have bigger problems...

@gavinandresen
Copy link
Contributor

Rebase needed.

@luke-jr
Copy link
Member Author

luke-jr commented Oct 25, 2013

Rebased. For purging from the map.. how about when we see a block confirm a transaction using it as an input?

@luke-jr
Copy link
Member Author

luke-jr commented Dec 3, 2013

Rebased and added mapDeltas pruning when transactions are removed from the memory pool (ie, included in a block).

@laanwj
Copy link
Member

laanwj commented Jun 3, 2014

This pull has been open for almost two years now.
What still has to be done for this to me merged? (apart from a rebase)

@jgarzik
Copy link
Contributor

jgarzik commented Jun 3, 2014

ACK -- appears to be done, to me, modulo a rebase.

This is IMO important to merge. We want to give miners controls like this, so that they may innovate and compete.

Related: Miners also need an "accept this TX even if it's non-standard" RPC or RPC flag.

@BitcoinPullTester
Copy link

Automatic sanity-testing: FAILED MERGE, see http://jenkins.bluematt.me/pull-tester/p1583_4427dc5e6a6fd0f7349e6ea3e0d6a084491cf265/ for test log.

This pull does not merge cleanly onto current master
This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/
Contact BlueMatt on freenode if something looks broken.

src/miner.cpp Outdated
Copy link
Member

Choose a reason for hiding this comment

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

These implementations should be in txmempool.cpp.

…ity tx fee>

Accepts the transaction into mined blocks at a higher (or lower) priority
@luke-jr
Copy link
Member Author

luke-jr commented Jun 26, 2014

Rebased with @laanwj 's change.

@laanwj laanwj merged commit 2a72d45 into bitcoin:master Jun 26, 2014
laanwj added a commit that referenced this pull request Jun 26, 2014
2a72d45 JSON-RPC method: prioritisetransaction <txid> <priority delta> <priority tx fee> (Luke Dashjr)
suprnurd pushed a commit to chaincoin-legacy/chaincoin that referenced this pull request Dec 5, 2017
lateminer pushed a commit to lateminer/bitcoin that referenced this pull request May 6, 2020
8108470 Update copyright headers for files changed in 2020 (Fuzzbawls)

Pull request description:

  pre-4.1 release update of the copyright headers

ACKs for top commit:
  furszy:
    utACK 8108470
  random-zebra:
    utACK 8108470 and merging...

Tree-SHA512: cd9874856e49f83c454f042d6ac0133e036e56d92c8daf250700299b8661472a1caffcf3c5d9f335f4369d3e5db605febd67e5fa755532e25eb02f882c96af99
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants