Skip to content

Era changes#159

Merged
afck merged 21 commits intocasper-network:masterfrom
afck:era_chg
Aug 26, 2020
Merged

Era changes#159
afck merged 21 commits intocasper-network:masterfrom
afck:era_chg

Conversation

@afck
Copy link
Copy Markdown
Contributor

@afck afck commented Aug 20, 2020

This generates the random bit, moves switch_block from ProtoBlock to FinalizedBlock, adds timestamp, era ID and height to FinalizedBlock and sets switch_block based on those values and the era configuration from the chainspec.

https://casperlabs.atlassian.net/browse/NDRS-223

Comment thread node/src/components/consensus/era_supervisor.rs
afck added 3 commits August 21, 2020 10:57
Use Params instead of long parameter lists in some places, and add more
parameters from constants to Params.
Comment thread node/src/components/consensus/consensus_protocol.rs Outdated
Comment thread node/src/components/consensus/era_supervisor.rs Outdated
Comment thread node/src/components/consensus/era_supervisor.rs Outdated
Put block rewards into a constant, remove duplicated switch block
detection from era supervisor, and rename `relative_height` to `height`.
@afck
Copy link
Copy Markdown
Contributor Author

afck commented Aug 21, 2020

Yes, exactly; as far as an individual ConsensusProtocol is concerned the "switch block" is the end.

afck added 5 commits August 24, 2020 12:49
The first `FinalizedBlock` in a new era must have the previous era's
switch block as a parent, not `None`.

Consensus protocol results from starting a new era must have the _new_
era's ID, not the old ones.

Eras start at 0, so if we are in era 2, we will have three entries: The
test checked only for two.
@afck afck marked this pull request as ready for review August 24, 2020 14:34
Comment thread node/src/components/consensus/era_supervisor.rs
afck added 2 commits August 25, 2020 15:04
RMP is what we use elsewhere, and secp256k1 signatures somehow fail to
deserialize if serialized with `serde_json::to_vec_pretty`.
@afck
Copy link
Copy Markdown
Contributor Author

afck commented Aug 25, 2020

I rebased and ran into a serialization issue. The solution for now was to switch from serde_json to rmp_serde, which is probably what we want anyway.

@Fraser999: I reverted the second half of #166, because it works with both key types now. Thanks for helping me with this!

Copy link
Copy Markdown
Contributor

@fizyk20 fizyk20 left a comment

Choose a reason for hiding this comment

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

Looking good, just some naming nitpicks ;)


/// Returns a temporary container with this `EraSupervisor`, `EffectBuilder` and random number
/// generator, for handling events.
pub(super) fn handling<'a, REv: ReactorEventT<I>>(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think the name is a bit confusing. How about something like handling_wrapper or wrapper_for_handling? Short names are nice, but this one made me scratch my head a few times...

@@ -181,6 +236,7 @@ where
pub(super) struct HandlingEraSupervisor<'a, I, REv: 'static, R: Rng + CryptoRng + ?Sized> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is also a bit of a weird name to me, but it's already established, so let's let it be ;)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I agree, I renamed it, too. It's not explicitly used often anyway, so it's fine if it has a long name.

@afck afck merged commit c3c0fc6 into casper-network:master Aug 26, 2020
@afck afck deleted the era_chg branch August 26, 2020 08:10
sacherjj added a commit that referenced this pull request Aug 2, 2024
rafal-ch pushed a commit that referenced this pull request Sep 11, 2024
* Implement `SMO` instruction

* Use `Address::LEN` for consistency

* Use only base asset for SMO
rafal-ch pushed a commit that referenced this pull request Sep 11, 2024
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

Successfully merging this pull request may close these issues.

3 participants