Skip to content

Address remaining comments from #131#138

Merged
afck merged 8 commits intocasper-network:masterfrom
afck:seigniorage
Aug 5, 2020
Merged

Address remaining comments from #131#138
afck merged 8 commits intocasper-network:masterfrom
afck:seigniorage

Conversation

@afck
Copy link
Contributor

@afck afck commented Aug 5, 2020

Address remaining code review comments from #131.

https://casperlabs.atlassian.net/browse/HWY-45

If the latest vote is before the beginning of the round, then the
validator didn't participate in the round, so `No` should be returned.
Comment on lines +398 to +405
Some((vh, vote)) if vote.round_exp <= r_id.trailing_zeros() => {
if vote.timestamp >= r_id {
RoundParticipation::Yes(vh)
} else {
RoundParticipation::No
}
}
Some((_, _)) => RoundParticipation::Unassigned,
Copy link
Contributor

Choose a reason for hiding this comment

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

Personally, I don't like when the order of cases changes the logic. I would have put all Some(…) under one case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll give it a try…

Copy link
Contributor

Choose a reason for hiding this comment

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

Might be bit less readable though – with two levels of ifs …

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added comments, as discussed.

@afck afck merged commit bb19177 into casper-network:master Aug 5, 2020
@afck afck deleted the seigniorage branch August 5, 2020 18:46
sacherjj pushed a commit that referenced this pull request Feb 8, 2024
138: Upgrade watcher changes r=Fraser999 a=Fraser999

This PR modifies the upgrade watcher to handle the case of a staged upgrade being removed.

In this case, the upgrade watcher sets the pending upgrade back to `None` and the node will not shut down for upgrade at the previously-specified activation point.

The main reactor's constructor also now checks for a staged upgrade being present with the same activation point as the current one.  In this case, the node shuts down for upgrade without creating any blocks.

Closes [#4489](#4489).

Co-authored-by: Fraser Hutchison <fraser@casperlabs.io>
rafal-ch pushed a commit that referenced this pull request Sep 11, 2024
The instruction executors are duplicated into different implementations
that either support the interpreter storage or don't. The latter is used
for predicate verification since contract opcodes, the only ones that
performs storage calls, aren't allowed.

This duplication will lead to harder long-term maintenance and should be
avoided.

The alternative introduced in this PR is to have a concrete storage
implementation that will deny any storage call, and introduce a check
for each instruction to evaluate if its predicate verification and if
the opcode is allowed for predicates.

This is sub-optimal because we introduce an extra branching per VM
cycle, but it can easily be refactored later to perform a couple of
bitwise operations after fuel-asm #68 is done.

Closes #133
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.

2 participants