이더리움 지분증명(4) - 마무리

이한길·2024년 7월 12일
0

이더리움

목록 보기
6/6

1. 비콘블록 생성

합의 클라이언트는 실행 페이로드를 합의 데이터로 래핑해 비콘블록(보상, 패널티, 슬래싱, 찬성 투표 등에 대한 정보를 포함)을 생성하여 네트워크의 다른 노드들에게 가십한다. 이 블록 생성은 이더로 보상받는다.

비콘블록바디(Beacon Block Body):

class BeaconBlockBody(Container):
    randao_reveal: BLSSignature
    eth1_data: Eth1Data  # Eth1 data vote
    graffiti: Bytes32  # Arbitrary data
    # Operations
    proposer_slashings: List[ProposerSlashing, MAX_PROPOSER_SLASHINGS]
    attester_slashings: List[AttesterSlashing, MAX_ATTESTER_SLASHINGS]
    attestations: List[Attestation, MAX_ATTESTATIONS]
    deposits: List[Deposit, MAX_DEPOSITS]
    voluntary_exits: List[SignedVoluntaryExit, MAX_VOLUNTARY_EXITS]
    sync_aggregate: SyncAggregate
    # Execution
    execution_payload: ExecutionPayload  # [Modified in Deneb:EIP4844]
    bls_to_execution_changes: List[SignedBLSToExecutionChange, MAX_BLS_TO_EXECUTION_CHANGES]
    blob_kzg_commitments: List[KZGCommitment, MAX_BLOB_COMMITMENTS_PER_BLOCK]  # [New in Deneb:EIP4844]
  • 랜다오값(randao_reveal): 다음 블록 제안자를 선택하는 데 사용되는 값.

  • 보증금 컨트랙트 정보(eth1_data): 보증금 계약에 대한 정보.

    class Eth1Data(Container):
        deposit_root: Root
        deposit_count: uint64
        block_hash: Bytes32
  • 그래피티(graffiti): 블록에 태그를 지정하는 데 사용되는 임의의 데이터.

  • 삭감 제안자 목록(proposer_slashings): 슬래시할 검증자 목록.

  • 삭감 증명자 목록(attester_slashings): 삭감될 증명자 목록.

  • 증명서 목록(attestations): 현재 블록을 지지하는 증명서 목록.

  • 신규 보증금 목록(deposits): 보증금 계약에 대한 신규 보증금 목록.

  • 퇴장 검증자 목록(voluntary_exits): 네트워크에서 나가는 검증자 목록.

    class VoluntaryExit(Container):
        epoch: Epoch  # Earliest epoch when voluntary exit can be processed
        validator_index: ValidatorIndex
  • 동기화 집계(sync_aggregate): 라이트 클라이언트를 수행하는 검증자들의 부분집합.

  • 실행 페이로드(execution_payload): 실행블록.

비콘블록(Beacon Block):

class BeaconBlock(Container):
    slot: Slot
    proposer_index: ValidatorIndex
    parent_root: Root
    state_root: Root
    body: BeaconBlockBody
  • 현재 슬롯(slot): 블록이 속한 슬롯.

  • 제안자 인덱스(proposer_index): 블록 제안자의 인덱스.

  • 이전 블록 해시(parent_root): 이전 블록의 해시.

  • 상태 루트 해시(state_root): 상태 객체의 루트 해시.

  • 바디(body): 비콘블록바디.

2. 최종화

검증자 클라이언트는 표준 블록체인에 있다고 판단한 체크포인트 블록에 찬성하는 투표를 전파한다. 그러면 검증자의 지분(최대 32 이더리움)에 따라 가중치가 부여된 투표가 가장 많이 누적된 체인이 올바른 체인으로 결정된다.

활성 검증자의 2/3가 블록을 지원하는 증명에 서명하면 해당 블록이 최종화 됩니다 (실제로는 더 복잡하여 두 라운드의 서명이 필요합니다. 자세한 내용은 Casper FFG 논문 참조). 누군가가 더 긴 체인을 만들면 모든 블록을 되돌릴 수 있는 PoW와 달리 최종화된 블록은 결코 되돌릴 수 없습니다.

3. 이더 언스테이킹

class Withdrawal(Container):
    index: WithdrawalIndex
    validator_index: ValidatorIndex
    address: ExecutionAddress
    amount: Gwei
profile
블록체인, 통계학, 수학, 인공지능 공부하고 있습니다

0개의 댓글