-
Notifications
You must be signed in to change notification settings - Fork 24
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
cuprated: txpool #312
cuprated: txpool #312
Conversation
return; | ||
}; | ||
|
||
// TODO: There is a race condition possible if a tx and block come in at the same time: <https://github.com/Cuprate/cuprate/issues/314>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The REORG_LOCK
is not enough to prevent certain situations, we will need a lock for every blockchain mutation. This shouldn't be too bad IMO, every ~2 mins needing to take a write lock, read locks will only need to be taken when multiple services are involved in handling a request,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be clear all this would allow is a double spend tx in the pool, and this would only happen in a very unlucky situation.
So not really an issue however IMO we should aim to be correct under all possible scenarios, being lax here might have consequence elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only nits, will review again
Btw the txpool issues should probably be |
I'm planning to mark the issues as help wanted when this is merged - I'll remove the |
|
||
/// An identifier for a P2P peer on any network. | ||
#[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
pub enum CrossNetworkInternalPeerId { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason this is defined here instead of in cuprate-p2p
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defining it here means we are more free to change it without it being a breaking change + this isn't used in cuprate-p2p
.
/// TODO: should we expose this? probably not. | ||
const DANDELION_CONFIG: DandelionConfig = DandelionConfig { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is eventually exposed, it could/should be an associated constant on the type:
impl DandelionConfig {
const CUPRATED_CONFIG: Self = /*...*/
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant exposed to users of cuprated
, I'll update the comment.
What
The transaction pool