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

[txpool] Initial impl of Transaction Pool #99

Merged
merged 19 commits into from Feb 2, 2022
Merged

[txpool] Initial impl of Transaction Pool #99

merged 19 commits into from Feb 2, 2022

Conversation

rakita
Copy link
Contributor

@rakita rakita commented Dec 29, 2021

  • [txpool] Some checks on inclusion
  • [txpool] Initial dependency insert
  • [txpool] dep insertion needs testing
  • [txpool] wip testing
  • [txpool] some testing data
  • [txpool] Initial subscriber. Some tidying up
  • [txpool] cleanup
  • [txpool] integration for fuel-core
  • [txpool] find dependent. fmt
  • [txpool] inclue utxo_id in dependency
  • [txpool] Initial test
  • [txpool] inclusion tests. Some fixes
  • [txpool] fmt,clippy,cargo-sort
  • [txpool] tx removal. subs tested
  • [txpool] small cleanups and refactoring

@rakita rakita self-assigned this Dec 29, 2021
@rakita
Copy link
Contributor Author

rakita commented Dec 30, 2021

CI build failed because we use branch of fuel-tx repo that is still private (i run locally cargo fmt, cargo build, cargo clippy), but other than that, it is feels okay to start review process on this module.

Additionaly, depending on how we are going to structure Fuel project we can move /libs/txpool/src/interface.rs to saparete library libs/interfaces so that dependencies on modules of our system are going to be binded throught that single lib interface (if it is actor based system than interface traits will become messages that we are going to send)

@rakita rakita marked this pull request as ready for review December 30, 2021 08:22
Cargo.toml Outdated Show resolved Hide resolved
@rakita rakita changed the base branch from master to utxo_id January 9, 2022 21:42
@rakita rakita force-pushed the rakita/txpool branch 3 times, most recently from 619b049 to 958d82a Compare January 11, 2022 18:42
Copy link
Contributor

@adlerjohn adlerjohn left a comment

Choose a reason for hiding this comment

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

Looks like CI breaking

@rakita
Copy link
Contributor Author

rakita commented Jan 13, 2022

Looks like CI breaking

cargo patch fails to load fuel-tx, i am blocked by fuel-tx not being published upstream.

@Voxelot Voxelot marked this pull request as draft January 17, 2022 18:26
Base automatically changed from utxo_id to master January 18, 2022 16:58
@rakita rakita marked this pull request as ready for review January 19, 2022 11:01
fuel-core/src/database.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@adlerjohn adlerjohn left a comment

Choose a reason for hiding this comment

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

lgtm, will defer to @Voxelot for final review!

@rakita rakita requested a review from Voxelot January 25, 2022 19:45
fuel-txpool/src/service.rs Outdated Show resolved Hide resolved
}

#[tokio::test]
async fn missing_dep_faulty_tx1_tx2() {
Copy link
Member

Choose a reason for hiding this comment

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

We should do better with our test names to clarify which requirements are being tested and what the expected behavior is. Referencing indices into helper data (tx1, tx2, etc) isn't a great way to clarify intent, and is harder to refactor if the test data changes over time.

Something like "insert_with_missing_input_coin_tx_fails" would be a lot more clear.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are data specific tests, if data changes it is like rewriting new test. But name of this particualr test is not the greatest, renamed it to: "fails_to_insert_tx2_with_missing_utxo_dependency_on_faulty_tx1"

Copy link
Member

@Voxelot Voxelot Jan 28, 2022

Choose a reason for hiding this comment

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

Ultimately what I'm getting at is we should rely more on conveying the requirements being tested, than the particular data being used. This is a good improvement, but some of the other tests could probably use similar improvements.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What test do you have in mind? btw to speed up this, be free to push commit dirrectly to branch i wouldn't mind, it is esentially change about preferences of test naming.

@Voxelot
Copy link
Member

Voxelot commented Jan 27, 2022

After my last round of comments is addressed I'll be ready to merge this in. Sorry for such a long cycle on this one, maybe in the future we should try to break something like this up into smaller PRs.

@rakita
Copy link
Contributor Author

rakita commented Jan 27, 2022

After my last round of comments is addressed I'll be ready to merge this in. Sorry for such a long cycle on this one, maybe in the future we should try to break something like this up into smaller PRs.

It is fine, it paid off to have longed cycle, you have found two bugs by just reviewing it.

Not sure if this could be devided into smaller chunk as it covers core mechanisms that txpool is going to function by, i did best to somehow contain it and leave some work for later.

I am currently diving into relayer, and will address/make changes probably later today or maybe tomorrow morning.

@rakita rakita requested a review from Voxelot February 1, 2022 08:40
@rakita rakita merged commit a96f1ba into master Feb 2, 2022
@rakita rakita deleted the rakita/txpool branch February 2, 2022 09:03
ControlCplusControlV pushed a commit that referenced this pull request Jan 15, 2023
* Run tests without std during CI

* Remove lazy static from test-helpers

* Rearrange ci workflows

* Update ci.yml

* Update ci.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants