Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Conversation

@marcio-diaz
Copy link
Contributor

@marcio-diaz marcio-diaz commented Jul 27, 2019

We need to submit report transactions when we discover an equivocation while importing (see here for definition of equivocation).

As a starting point, this PR adds the transaction pool to Aura and Babe import queue (and check_header).

@marcio-diaz marcio-diaz added the A0-please_review Pull request needs code review. label Jul 27, 2019
@tomaka
Copy link
Contributor

tomaka commented Jul 27, 2019

Please add a comment in the Babe code explaining why we're passing the transaction pool. The comment can later be removed when we actually use it, but for now I'd prefer if there was an explanation.

We merge many PRs that add code "for later", and we end up not using that code, and then nobody remembers why it's there nor dares to remove it.

@bkchr
Copy link
Member

bkchr commented Jul 27, 2019

I would go even further as @tomaka and say, why not build directly the full functionality? This is no big change, which can be reviewed together with the actual functionality.

@marcio-diaz
Copy link
Contributor Author

marcio-diaz commented Jul 27, 2019

I would go even further as @tomaka and say, why not build directly the full functionality? This is no big change, which can be reviewed together with the actual functionality.

The full functionality may be too much for a PR. But sure, I can push more code to give a bigger picture to the reviewers.

@marcio-diaz marcio-diaz force-pushed the marcio/add-tx-pool-to-import-queue branch from 49d94c7 to a224ac5 Compare July 29, 2019 14:29
@marcio-diaz
Copy link
Contributor Author

I added some more code, but looks like I can't go much further. The full functionality depends on #3063 and #3137 at least.

Copy link
Contributor

@Demi-Marie Demi-Marie left a comment

Choose a reason for hiding this comment

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

The completed code looks good so far, but there is a long ways to go.

@andresilva andresilva added A3-in_progress Pull request is in progress. No review needed at this stage. and removed A0-please_review Pull request needs code review. labels Jul 29, 2019
Copy link
Contributor

@andresilva andresilva left a comment

Choose a reason for hiding this comment

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

This is not reviewable. You bundled a bunch of changes from other PRs into a single commit (599c8b1). If you depend on other PRs the correct way to do it is to create a branch that descends from the one you depend on. FWIW I'm fine with merging just the changes to introduce the transaction pool to Babe (and Aura!) without depending on any pending PRs, provided that we comment it like @tomaka suggested.

@marcio-diaz
Copy link
Contributor Author

marcio-diaz commented Jul 29, 2019

This is not reviewable. You bundled a bunch of changes from other PRs into a single commit (599c8b1). If you depend on other PRs the correct way to do it is to create a branch that descends from the one you depend on. FWIW I'm fine with merging just the changes to introduce the transaction pool to Babe (and Aura!) without depending on any pending PRs, provided that we comment it like @tomaka suggested.

I have not intention to merge the other PR, just to use it as a guide.

I'll follow the suggestions of @tomaka and @andresilva and just introduce the changes for the tx pool in Aura and Babe as was originally intended.

@marcio-diaz marcio-diaz force-pushed the marcio/add-tx-pool-to-import-queue branch from a224ac5 to 4b8384c Compare July 29, 2019 16:22
@marcio-diaz marcio-diaz changed the title Add transaction pool to Babe import queue Add transaction pool to Aura and Babe import queue Jul 30, 2019
@marcio-diaz marcio-diaz dismissed stale reviews from andresilva and Demi-Marie July 30, 2019 10:48

old

@marcio-diaz marcio-diaz added A0-please_review Pull request needs code review. and removed A3-in_progress Pull request is in progress. No review needed at this stage. labels Jul 30, 2019
@marcio-diaz marcio-diaz requested a review from andresilva July 30, 2019 10:49
@marcio-diaz marcio-diaz force-pushed the marcio/add-tx-pool-to-import-queue branch from 1c15e2c to 5c7c389 Compare July 30, 2019 11:45
@marcio-diaz
Copy link
Contributor Author

marcio-diaz commented Jul 31, 2019

This is ready for review, I added the tx pool to Aura too.

@marcio-diaz marcio-diaz requested a review from Demi-Marie July 31, 2019 10:28
Copy link
Contributor

@andresilva andresilva left a comment

Choose a reason for hiding this comment

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

When you actually want to use the transaction pool you will need to add some trait bounds to T. Right now it is just a generic type from which we cannot infer anything. I think we should add the correct bounds in this PR so that it is usable (even though it won't be used in this PR).

Copy link
Contributor

@Demi-Marie Demi-Marie left a comment

Choose a reason for hiding this comment

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

LGTM

@Demi-Marie Demi-Marie requested a review from andresilva August 1, 2019 16:36
@gavofyork gavofyork removed the A0-please_review Pull request needs code review. label Aug 7, 2019
Copy link
Contributor

@andresilva andresilva left a comment

Choose a reason for hiding this comment

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

As discussed offline this is not usable as is, since the T type is not bound by anything. @marcio-diaz did some changes to fix this on another branch not sure if we wants to get them here or not.

@marcio-diaz
Copy link
Contributor Author

As discussed offline this is not usable as is, since the T type is not bound by anything. @marcio-diaz did some changes to fix this on another branch not sure if we wants to get them here or not.

Now, that I read the comment again, it feels like an arbitrary decision.
T is useless with or without bound, and adding it doesn't look perfect either.
IMO, the point of splitting the other big PR was to facilitate review and merging.
If anyways we are going to merge this in a few days, then why not merging it now?

@andresilva
Copy link
Contributor

IMO my comment is justified, this PR is titled "Add transaction pool", and it adds a type T which does not relate at all to a TransactionPool, so as a logical unit of work it doesn't accomplish what it says it does. You added a trait SubmitExtrinsic here (#3314) which solves this exact problem, my suggestion was to add something like that here in this PR. If that is done then in this PR we have a small set of changes and something that is logically correct (even though it is unused). I am OK with merging this anyway and just doing those changes in the other PR to avoid more work on this, but it has conflicts now.

@marcio-diaz marcio-diaz force-pushed the marcio/add-tx-pool-to-import-queue branch from 25c6d8c to c872ede Compare August 12, 2019 08:04
@marcio-diaz
Copy link
Contributor Author

@andresilva Thanks, conflicts solved.

@gavofyork
Copy link
Member

@andresilva if you're happy with it, then please merge.

@andresilva andresilva merged commit 6fbca29 into master Aug 13, 2019
@andresilva andresilva deleted the marcio/add-tx-pool-to-import-queue branch August 13, 2019 09:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants