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

Add quiz: staking #10476

Merged
merged 7 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/content/staking/solo/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,5 @@ To unlock and receive your entire balance back you must also complete the proces
- [How To: Shop For Ethereum Validator Hardware](https://www.youtube.com/watch?v=C2wwu1IlhDc) - _EthStaker 2022_
- [Step by Step: How to join the Ethereum 2.0 Testnet](https://kb.beaconcha.in/guides/tutorial-eth2-multiclient) - _Butta_
- [Eth2 Slashing Prevention Tips](https://medium.com/prysmatic-labs/eth2-slashing-prevention-tips-f6faa5025f50) - _Raul Jordan 2020_

<QuizWidget quizKey="solo-staking" />
9 changes: 9 additions & 0 deletions src/data/quizzes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ const quizzes: RawQuizzes = {
title: "page-assets-merge",
questions: ["h001", "h002", "h003", "h004", "h005"],
},
"solo-staking": {
title: "solo",
questions: ["j001", "j002", "j004", "j005", "j006", "j007", "j008"],
},
}

export const ethereumBasicsQuizzes: QuizzesSection[] = [
Expand Down Expand Up @@ -78,6 +82,11 @@ export const usingEthereumQuizzes: QuizzesSection[] = [
{
id: "layer-2",
level: "intermediate",
next: "solo-staking",
},
{
id: "solo-staking",
level: "advanced",
},
]

Expand Down
208 changes: 208 additions & 0 deletions src/data/quizzes/questionBank.ts
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,214 @@ const questionBank: QuestionBank = {
],
correctAnswerId: "h005-b",
},
j001: {
prompt: "j001-prompt",
answers: [
{
id: "j001-a",
label: "j001-a-label",
explanation: "j001-a-explanation",
},
{
id: "j001-b",
label: "j001-b-label",
explanation: "j001-b-explanation",
},
{
id: "j001-c",
label: "j001-c-label",
explanation: "j001-c-explanation",
},
{
id: "j001-d",
label: "j001-d-label",
explanation: "j001-d-explanation",
},
],
correctAnswerId: "j001-d",
},
j002: {
prompt: "j002-prompt",
answers: [
{
id: "j002-a",
label: "j002-a-label",
explanation: "j002-a-explanation",
},
{
id: "j002-b",
label: "j002-b-label",
explanation: "j002-b-explanation",
},
{
id: "j002-c",
label: "j002-c-label",
explanation: "j002-c-explanation",
},
{
id: "j002-d",
label: "j002-d-label",
explanation: "j002-d-explanation",
},
],
correctAnswerId: "j002-b",
},
j003: {
prompt: "j003-prompt",
answers: [
{
id: "j003-a",
label: "j003-a-label",
explanation: "j003-a-explanation",
},
{
id: "j003-b",
label: "j003-b-label",
explanation: "j003-b-explanation",
},
{
id: "j003-c",
label: "j003-c-label",
explanation: "j003-c-explanation",
},
{
id: "j003-d",
label: "j003-d-label",
explanation: "j003-d-explanation",
},
],
correctAnswerId: "j003-b",
},
j004: {
prompt: "j004-prompt",
answers: [
{
id: "j004-a",
label: "j004-a-label",
explanation: "j004-a-explanation",
},
{
id: "j004-b",
label: "j004-b-label",
explanation: "j004-b-explanation",
},
{
id: "j004-c",
label: "j004-c-label",
explanation: "j004-c-explanation",
},
{
id: "j004-d",
label: "j004-d-label",
explanation: "j004-d-explanation",
},
],
correctAnswerId: "j004-d",
},
j005: {
prompt: "j005-prompt",
answers: [
{
id: "j005-a",
label: "j005-a-label",
explanation: "j005-a-explanation",
},
{
id: "j005-b",
label: "j005-b-label",
explanation: "j005-b-explanation",
},
{
id: "j005-c",
label: "j005-c-label",
explanation: "j005-c-explanation",
},
{
id: "j005-d",
label: "j005-d-label",
explanation: "j005-d-explanation",
},
],
correctAnswerId: "j005-c",
},
j006: {
prompt: "j006-prompt",
answers: [
{
id: "j006-a",
label: "j006-a-label",
explanation: "j006-a-explanation",
},
{
id: "j006-b",
label: "j006-b-label",
explanation: "j006-b-explanation",
},
{
id: "j006-c",
label: "j006-c-label",
explanation: "j006-b-explanation",
},
{
id: "j006-d",
label: "j006-d-label",
explanation: "j006-b-explanation",
},
],
correctAnswerId: "j006-a",
},
j007: {
prompt: "j007-prompt",
answers: [
{
id: "j007-a",
label: "j007-a-label",
explanation: "j007-a-explanation",
},
{
id: "j007-b",
label: "j007-b-label",
explanation: "j007-b-explanation",
},
{
id: "j007-c",
label: "j007-c-label",
explanation: "j007-c-explanation",
},
{
id: "j007-d",
label: "j007-d-label",
explanation: "j007-d-explanation",
},
],
correctAnswerId: "j007-c",
},
j008: {
prompt: "j008-prompt",
answers: [
{
id: "j008-a",
label: "j008-a-label",
explanation: "j008-a-explanation",
},
{
id: "j008-b",
label: "j008-b-label",
explanation: "j008-b-explanation",
},
{
id: "j008-c",
label: "j008-c-label",
explanation: "j008-c-explanation",
},
{
id: "j008-d",
label: "j008-d-label",
explanation: "j008-d-explanation",
},
],
correctAnswerId: "j008-d",
},
}

export default questionBank
72 changes: 71 additions & 1 deletion src/intl/en/learn-quizzes.json
Original file line number Diff line number Diff line change
Expand Up @@ -324,5 +324,75 @@
"h005-c-label": "Eth1",
"h005-c-explanation": "Eth1 was the original name given to the execution layer, not the consensus layer.",
"h005-d-label": "Staking",
"h005-d-explanation": "Staking is depositing ETH into a smart contract to help secure the chain."
"h005-d-explanation": "Staking is depositing ETH into a smart contract to help secure the chain.",
"j001-prompt": "Which is true about slashing?",
"j001-a-label": "Penalty for being offline, rewards resume when back online",
"j001-a-explanation": "Being offline does NOT result in slashing. Small penalties are incurred for being offline, and rewards resume when the validator returns online and resumes attestations.",
"j001-b-label": "Penalty for being offline, validator is immediately prohibited from attesting ever again",
"j001-b-explanation": "Being offline does NOT result in slashing. While slashing will result in the validator being prohibited from ever attesting again and is ultimately forcefully ejected, being offline will NOT result in ejection from the network.",
"j001-c-label": "Penalty for breaking specific consensus rules, rewards resume after slashing",
"j001-c-explanation": "Slashing is a serious penalty for breaking specific consensus rules that present a threat to the network. As such, once a validator is slashed they are immediately prohibited from attesting any further, and are ultimately forcefully ejected from the network and remaining ETH is withdrawn to the owner.",
"j001-d-label": "Penalty for breaking specific consensus rules, validator is immediately prohibited from attesting ever again",
"j001-d-explanation": "Slashing is a serious penalty for breaking specific consensus rules that present a threat to the network. As such, once a validator is slashed they are immediately prohibited from attesting any further, and are ultimately forcefully ejected from the network and remaining ETH is withdrawn to the owner.",
"j002-prompt": "What happens if a validator goes offline?",
"j002-a-label": "No affect on rewards",
"j002-a-explanation": "Penalties are incurred when a validator is unavailable to attest to the state of the chain for any given epoch. The size of these penalties is approximately equal to 75% of what the reward for a proper attestation would have been. Rewards resume when validator goes back online, and NO slashing occurs.",
"j002-b-label": "Inactivity penalties are incurred only while unavailable",
"j002-b-explanation": "While unavailable, a validator will incur small inactivity penalties, approximately equal to 75% of what the reward would have been for a proper attestation. In rare/extreme cases where the network is not finalizing (i.e. over 1/3 of the network is also offline), these penalties are significantly greater. Rewards resume when validator goes back online, and no slashing occurs.",
"j002-c-label": "Immediate slashing and removal from the network",
"j002-c-explanation": "This is a common misconception, but going offline does NOT result in slashing! Slashing is a specific type of penalty for more serious offense, with larger penalties and also results in removal from the validator set.",
"j002-d-label": "One week delay before slashing and ejection",
"j002-d-explanation": "Being offline does NOT result in slashing, even after extended period of time. A validator could theoretically be offline for years without being slashed, though inactivity penalties would mount if the validator does not exit.",
"j003-prompt": "What is the max effective balance of a validator?",
wackerow marked this conversation as resolved.
Show resolved Hide resolved
"j003-a-label": "16",
"j003-a-explanation": "Validators who drop to an effective balance of 16 ETH are automatically exited from the Beacon Chain.",
"j003-b-label": "32",
"j003-b-explanation": "32 ETH is both the minimum ETH required to activate a new validator, and also the maximum 'effective balance' (vote weight) for that validator. Rewards above 32 can be accrued, but this balance does not contribute to the weight of that validators vote on the network and rewards are not increased.",
"j003-c-label": "Variable depending on the operator",
"j003-c-explanation": "The rules of consensus apply to every validator account equally and are not dependent upon the individual operating the node. The max effective balance of all validators is 32 ETH.",
"j003-d-label": "No limit",
"j003-d-explanation": "Each validator account is limited to an effective balance of 32 ETH, limiting the overall power of any single validator on the network. This also limits how much ETH can be staked or un-staked in a given time period, as validator activations and exits are processed through a rate-limited queue.",
"j004-prompt": "Which is NOT a reward received as a validator?",
wackerow marked this conversation as resolved.
Show resolved Hide resolved
"j004-a-label": "Block reward",
"j004-a-explanation": "Validators receive rewards in the form of new ETH issuance for proposing a valid block when randomly selected by the protocol. These rewards are separate from the fees and MEV that are also earned when proposing blocks.",
"j004-b-label": "Fee tips / MEV",
"j004-b-explanation": "Fee tips (unburnt portion of fees) and MEV earnings are distributed to the block proposer (staker/validator) via the fee recipient address provided by that validator. These rewards are separate from the block reward also earned when proposing blocks.",
"j004-c-label": "Head of chain attestation reward",
"j004-c-explanation": "Validators receive rewards in the form of new ETH issuance for correctly and promptly attesting to the head of the chain, the current justified epoch head, and the current finalized epoch head.",
"j004-d-label": "Uniswap trading fees",
"j004-d-explanation": "Trading fees generated by trading platforms and exchanges are not received by Ethereum validators.",
"j005-prompt": "What uptime is required for a validator to be profitable?",
"j005-a-label": "100%",
"j005-a-explanation": "Although an ideal target, achieving 100% uptime is not the minimum requirement for a validator to remain profitable.",
"j005-b-label": "~99%",
"j005-b-explanation": "Although an excellent target, achieving 99% uptime is not the minimum requirement for a validator to remain profitable.",
"j005-c-label": "~50%",
"j005-c-explanation": "Validators are penalized approximately 75% of what they would have been rewarded for correctly and promptly attesting to the state of the chain. This means for a given time period, being offline 50% of that time will still be net profitable, albeit less profitable than a more reliably available validator.",
"j005-d-label": "~25%",
"j005-d-explanation": "A validator with only 25% uptime will be incurring penalties for the other 75% of the time. Given the similar size of rewards and penalties, being offline for 3x the amount of time online will result in a net loss of ETH for that time period.",
"j006-prompt": "Which of the following is NOT a slashable offense?",
"j006-a-label": "Being offline",
"j006-a-explanation": "Simply being offline does not result in slashing. It will result in small inactivity penalties while offline, but will resume attesting when back online.",
"j006-b-label": "Proposing and signing two different blocks for the same slot",
"j006-b-explanation": "This threatens the integrity of the network and will result in slashing and ejection from the network.",
"j006-c-label": "Attesting to a block that 'surrounds' another one (effectively changing history)",
"j006-d-label": "'Double voting' by attesting to two candidates for the same block",
"j007-prompt": "Which is NOT a way to protect/prevent your validator from being slashed?",
"j007-a-label": "Avoid overly redundant setups, and only store your keys with one validator client at a time",
"j007-a-explanation": "The majority of slashing to date are from operators storing their signing keys on more than one machine, as a redundant backup. This is highly risky, as any malfunction can result in double voting and slashing.",
"j007-b-label": "Run client software as-is without altering the code yourself",
"j007-b-explanation": "Client software is written and tested to protect against performing slashable actions. To execute a slashable action, this would typically require altering the client code yourself in a malicious manner.",
"j007-c-label": "Run a client that is being used by the majority of other validators",
"j007-c-explanation": "Using the same client as a majority of the rest of the network puts you at risk for being slashed in the event of a software bug in that client. Running a minority client protects against this.",
"j007-d-label": "Disable validator for 2-4 epochs before migrating keys to a new machine",
"j007-d-explanation": "This allows time to allow the chain to finalize while your node is offline, to minimize any risk of accidental double voting and slashing during key migration.",
"j008-prompt": "Which is NOT required to receive reward payments / partial withdrawals?",
"j008-a-label": "Providing an execution withdrawal address one time",
"j008-a-explanation": "This is required once for the withdrawal process to know where to send any consensus layer funds to",
"j008-b-label": "Having an effective balance of 32 ETH",
"j008-b-explanation": "Your effective balance must be maxed out at 32 ETH before any partial withdrawals will trigger.",
"j008-c-label": "Having a total balance over 32 ETH",
"j008-c-explanation": "Your total balance must have rewards above 32 ETH for any partial withdrawals to trigger.",
"j008-d-label": "Submitting requested withdrawal amount with gas payment",
"j008-d-explanation": "Once the other criteria are met, reward payments are automatic. Recipients do not need to submit a transaction or pay gas. Amount withdrawn is equal to validator's balance in excess of 32. Custom amounts cannot be requested."
}
4 changes: 3 additions & 1 deletion src/templates/staking.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import StakingGuides from "../components/Staking/StakingGuides"
import WithdrawalCredentials from "../components/Staking/WithdrawalCredentials"
import WithdrawalsTabComparison from "../components/Staking/WithdrawalsTabComparison"
import Callout from "../components/Callout"
import QuizWidget from "../components/Quiz/QuizWidget"

import { isLangRightToLeft, TranslationKey } from "../utils/translations"
import { Lang } from "../utils/languages"
Expand Down Expand Up @@ -309,6 +310,7 @@ const components = {
InfoGrid,
Logo,
MeetupList,
QuizWidget,
ProductDisclaimer,
RandomAppList,
SectionNav,
Expand Down Expand Up @@ -472,7 +474,7 @@ export const stakingPageQuery = graphql`
locales: allLocale(
filter: {
language: { in: $languagesToFetch }
ns: { in: ["page-staking", "common"] }
ns: { in: ["page-staking", "learn-quizzes", "common"] }
}
) {
edges {
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export interface RawQuizzes {
[key: string]: RawQuiz
}

type QuizLevel = "beginner" | "intermediate"
type QuizLevel = "beginner" | "intermediate" | "advanced"

export type QuizzesSection = {
id: string
Expand Down
Loading