Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Cost Model to limit transactions which are not parallelizeable (backport #16694) #18692

Closed
wants to merge 1 commit into from

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jul 15, 2021

This is an automatic backport of pull request #16694 done by Mergify.
Cherry-pick of b000d49 has failed:

On branch mergify/bp/v1.7/pr-16694
Your branch is up to date with 'origin/v1.7'.

You are currently cherry-picking commit b000d490c.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   core/src/cost_model.rs
	new file:   core/src/cost_tracker.rs
	modified:   core/src/lib.rs

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   Cargo.lock
	both modified:   core/Cargo.toml
	both modified:   core/benches/banking_stage.rs
	both modified:   core/src/banking_stage.rs

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.io/

* * Add following to banking_stage:
  1. CostModel as immutable ref shared between threads, to provide estimated cost for transactions.
  2. CostTracker which is shared between threads, tracks transaction costs for each block.

* replace hard coded program ID with id() calls

* Add Account Access Cost as part of TransactionCost. Account Access cost are weighted differently between read and write, signed and non-signed.

* Establish instruction_execution_cost_table, add function to update or insert instruction cost, unit tested. It is read-only for now; it allows Replay to insert realtime instruction execution costs to the table.

* add test for cost_tracker atomically try_add operation, serves as safety guard for future changes

* check cost against local copy of cost_tracker, return transactions that would exceed limit as unprocessed transaction to be buffered; only apply bank processed transactions cost to tracker;

* bencher to new banking_stage with max cost limit to allow cost model being hit consistently during bench iterations

(cherry picked from commit b000d49)

# Conflicts:
#	Cargo.lock
#	core/Cargo.toml
#	core/benches/banking_stage.rs
#	core/src/banking_stage.rs
@mergify mergify bot added the conflicts label Jul 15, 2021
@tao-stones tao-stones closed this Jul 15, 2021
@mergify mergify bot deleted the mergify/bp/v1.7/pr-16694 branch July 15, 2021 16:24
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.

1 participant