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

Initial staking pallet #188

Closed
wants to merge 99 commits into from
Closed

Initial staking pallet #188

wants to merge 99 commits into from

Conversation

kayabaNerve
Copy link
Member

Implements #146.

@kayabaNerve kayabaNerve added the feature New feature or request label Dec 8, 2022
@kayabaNerve
Copy link
Member Author

This needs to be rebased and remove the current DPoS-style system for a single potentially delegating owner key.

It also should track which module allocated and not allow deallocations exceeding that module's balance.

Removes use of the Parity CI image. Always uses slim variants.
Also creates a dedicated file for the message log.
Ideally, this would be generic. Unfortunately, the generic API serde
doesn't natively support borsh, nor SCALE, and while there is a serde
SCALE crate, it's old. While it may be complete, it's not worth working
with.

While we could still grab bincode, and a variety of other formats, it
wasn't worth it to go custom and for Serai, we'll be using SCALE almost
everywhere anyways.
Greatly simplifies verifying when syncing.
Also attempts to make the code more readable while updating/correcting
documentation.
Greatly increases safety as well by ensuring only one message is
processed at once.
Unfortunately, this immediately makes Tendermint machine capable of
deployment as  crate since it uses a git reference. In the future, a
Cargo.toml patch section for serai/substrate should be investigated.
This is being done regardless as it's the quickest way forward and this
is for Serai.
The BasicQueue returned obscures the TendermintImport struct.
Accordingly, a Future scoped with access is returned upwards, which when
awaited will create the machine. This makes creating the machine
optional while maintaining scope boundaries.

Is sufficient to create a 1-node net which produces and finalizes
blocks.
By claiming File, they're not sent ovber the P2P network before they
have a justification, as desired. Unfortunately, they never were. This
works around that.
The round was usable to build the current clock in an accumulated
fashion, relative to the previous round. The end time is the absolute
metric of it, which can be used to calculate the round number (with all
previous end times).

Substrate now builds off the best block, not genesis, using the end time
included in the justification to start its machine in a synchronized
state.

Knowing the end time of a round, or the round in which block was
committed to, is necessary for nodes to sync up with Tendermint.
Encoding it in the commit ensures it's long lasting and makes it readily
available, without the load of an entire transaction.
kayabaNerve and others added 26 commits July 26, 2023 03:13
Also fixes a bug where invalid precommit signatures were left standing
and therefore contributing to commits.
Also flattens the message handling function by replacing an if
containing all following code in the function with an early return for
the else case.
It was used as inclusive yet didn't work inclusively.
Yanks tendermint-machine 0.1.0 accordingly.
Merges it into new. It has way too many arguments, yet there's no clear path at
consolidation there, unfortunately.

Additionally provides better scoping within itself.
Possible since it's only a single node, not requiring synchronization.
This was a messy as hell, blunt forced rebase, but it's done.
@kayabaNerve
Copy link
Member Author

Deprecated for #373

@kayabaNerve kayabaNerve deleted the staking branch October 16, 2023 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants