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

Multiple nonces #466

Merged
merged 6 commits into from
Dec 3, 2023
Merged

Multiple nonces #466

merged 6 commits into from
Dec 3, 2023

Conversation

kayabaNerve
Copy link
Member

Adds support for multiple nonces to Tributary's Signed transactions, just like Provided.

Enables removing NonceDecider, simplifying that out a bit. The other option would be to remove nonces entirely, yet that means two different servers could publish distinct transactions with the same effective intent. With the nonce system, we achieve effective de-duplication.

I'm not convinced this is the right move forward, yet want to run it in the CI, create a PR so it's properly indexed by GH, etc.

This mirrors how Provided TXs handle topics.

Now, instead of managing a global nonce stream, we can use items such as plan
IDs as topics.

This massively benefits re-attempts, as else we'd need a NOP TX to clear unused
nonces.
@kayabaNerve kayabaNerve added the feature New feature or request label Dec 2, 2023
@kayabaNerve
Copy link
Member Author

kayabaNerve commented Dec 2, 2023

This increases the complexity of the Tributary.

This removes the potential for an honest node to publish the same intent across two distinct nonces due to syncing an alternate chain. This is a theoretical improvement to the security an honest node has when operating over multiple chains. If the malicious supermajority was ever asked to provide evidence, the same intent across multiple nonces would be valid evidence. With this, all that exists is multiple sets of data under the same intent within a nonce.

This removes the ability for a malicious node to publish conflicting intents (DkgConfirmed and InvalidShare) or publish on-chain multiple instances of an intent.

This saves 4 bytes per every transaction (the nonce, which is no longer broadcast).

This increases the on-chain DB usage of the Tributary. A nonce must now be saved for every single intent, instead of just for every account. This is likely as bad or slightly better than storing every single TX hash on the DB (due to the key length for the nonces being ~40 bytes, and only getting a couple uses).

@kayabaNerve
Copy link
Member Author

We could also replace the nonce system with an intent system. That'd remove the de-duplication this PR offers of keys (as we'd have to save multiple copies of the intent as a key), though the DB likely optimizes that. It'd also remove the ability to require one TX be published before another.

It would simplify this somewhat though.

I don't know why this didn't trigger for me. Potentially a difference in the
month of the nightly clippy?
@kayabaNerve
Copy link
Member Author

kayabaNerve commented Dec 3, 2023

This is also slightly more robust in that it allows any individual TX to take an arbitrary amount of time without stalling the global queue.

@kayabaNerve
Copy link
Member Author

The only downsides are the increased storage use and potential increase in complexity.

Given the storage is ephemeral, and this removes a bit of complexity with it.... Leaning towards merge.

@kayabaNerve kayabaNerve merged commit 4446a36 into develop Dec 3, 2023
9 checks passed
@kayabaNerve kayabaNerve deleted the multiple-nonces branch December 3, 2023 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
coordinator feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant