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

By default, don't allow sends unless previous is confirmed? #3166

Open
qwahzi opened this issue Mar 25, 2021 · 10 comments
Open

By default, don't allow sends unless previous is confirmed? #3166

qwahzi opened this issue Mar 25, 2021 · 10 comments

Comments

@qwahzi
Copy link
Collaborator

qwahzi commented Mar 25, 2021

Per the recent spam, it seems like one issue that causes compounding problems is nodes that send long chains of unconfirmed transactions that need to get resolved, but some of those transactions get lost in the backlog, or end up as forks that need (and struggle) to get resolved

Would it make sense to change the default node behavior to only send if "previous" is locally confirmed, unless overridden by a "force" option? That might help shrink backlogs, allow for easier fork resolution, and prevent potential work re-work

EDIT:

"A better solution to #3166 (don't send unless previous has been confirmed) has already been implemented here #4454 afaik. Instead of limiting legit services to wait for the previous confirmation, all the PRs in the network wait for the previous confirmation before publishing the block. So we have the best of both worlds. Reduced traffic and no artificial limits for legit services that want to publish all their blocks at once."

@Gyakusetsu
Copy link

Gyakusetsu commented Mar 25, 2021

And also from Algorand: https://www.algorand.com/resources/blog/algorands-core-technology-in-a-nutshell/

Algorand’s Non-Forkable Chain.
An additional advantage of Algorand’s technology is that its chain never forks. This is so because only one block can have the required threshold of committee votes. Accordingly, in Algorand all transactions are final. Once a block appears, you can count on it to be forever part of the chain. And if the new block contains a payment made to you, you may consider yourself paid and send the goods immediately.

And obviously it will prevent election backlogs in case of double-spend spam.

@bbedward
Copy link
Contributor

I disagree with this idea, queuing transactions is something that should be handled by the node/protocol (as it currently is). It would be atypical to have this queuing be implemented at the application level and would complicate Nano integrations. With traditional blockchains you queue as many transactions as you want in the mempool.

@qwahzi
Copy link
Collaborator Author

qwahzi commented Mar 26, 2021

I disagree with this idea, queuing transactions is something that should be handled by the node/protocol (as it currently is). It would be atypical to have this queuing be implemented at the application level and would complicate Nano integrations. With traditional blockchains you queue as many transactions as you want in the mempool.

This wouldn't remove queuing from the protocol - it would only change the default node behavior to local queuing if "previous" is unconfirmed (to slow down the publishing of extended unconfirmed transaction chains, unless forced)

What's the benefit to publishing transactions if the required "previous" is unconfirmed and may get rolled back? Seems like you'd have to wait the same amount of time in either case, except default local queuing reduces potential forks (more costly for the network to resolve) and the compounding effect of a network backlog/slowdown. If "previous" is locally confirmed, then nothing changes anyways

@Gyakusetsu
Copy link

Gyakusetsu commented Mar 26, 2021

Hi @qwahzi can you propose and share this in nano forum, protocol design?

@qwahzi
Copy link
Collaborator Author

qwahzi commented Mar 28, 2021

Hi @qwahzi can you propose and share this in nano forum, protocol design?

Done!

https://forum.nano.org/t/by-default-dont-allow-sends-unless-previous-is-confirmed/1888

@qwahzi
Copy link
Collaborator Author

qwahzi commented May 21, 2021

Related to this - the default behavior for auto-receives should be not to happen for unconfirmed sends, no?

@qwahzi qwahzi added this to the Research for Future Release milestone Jan 9, 2023
@SparK-Cruz
Copy link

+1 for this to be added:

  • Not broadcasting blocks which prev is not confirmed
  • Not broadcasting blocks which link is a block and is not confirmed (receives with unconfirmed sends)

Client handling their own block queue makes a lot of sense to me.

(I'd go as far as suggesting dropping those block all together but not broadcasting until they are ready is enough)

@darwin-brandao
Copy link

Agreed.

@SparK-Cruz
Copy link

@gr0vity-dev, you mentioned #4454 as a better solution for this on 4476, which I agree. But you also mentioned something about reps having a different behavior. Or did I read it wrong again?

@gr0vity-dev
Copy link
Contributor

If I understand this proposal correctly, it wants to limit the sender to only publish blocks with a confirmed predecessor in order to reduce reduce traffic ? This alone doesn't really help mitigate spam. An attacker could either use their own scripts to publish all the blocks or use the "force" flag.
#4454 addresses this in a more complete manner without limiting legit services.
You can still publish whatever blocks you want. However the representatives only gossip the checked blocks when the predecessor is confirmed. Representatives take care of the traffic, users are not limited in any way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants