區塊鏈
挖礦,比特幣,EOS,以太坊

以太坊ETH開發教程,以太坊2.0規范:Casper和分片!

譯者按:以太坊2.0是指以Casper、分片等技術為核心,旨在大幅擴容以太坊平臺的方案,而其中就涉及到一個稱為“beacon鏈”的核心PoS鏈概念,而它與以太坊PoW主鏈之間會是什么樣的關系呢?據悉,這一概念最初是由以太坊創始人Vitalik Buterin在今年初時提出的,目前在JustinDrake、djrtwo以及mkalinin三人的幫助下繼續完善。截至發稿時,以太坊2.0的規范完成度接近了60%。

注:文章中的內容反映的是以太坊研究人員和實施者正在進行當中的工作,但其需要不斷地完善。

eth2.0以下為規范譯文:在以太坊2.0當中,有一個被稱為“beacon鏈”的核心系統鏈,這個beacon鏈負責存儲和管理當前活躍PoS驗證者的集合。而最初成為驗證者的唯一機制,是在現有的以太坊1.0 PoW主鏈發送一筆包含32 ETH?的交易至一個注冊合約。當你這樣做時,一旦PoS鏈處理了該區塊,你就會進入隊列,并最終成為一名活躍驗證者。當然,你也可以自愿注銷驗證者身份,或者因為自己的不當行為而被強行注銷身份。

beacon鏈的主要負載來源是證明(attestation)。這些證明會同時確認一個分片區塊,以及相對應的beacon鏈區塊。對于相同的分片區塊,足夠數量的證明就創建了一個“交聯”(crosslink)。“交聯”用于“確認”分片鏈的片段進入了主鏈,并且這也是不同分片之間互相通信的主要方式。

注:項目的python代碼庫地址為:https://github.com/ethereum/beacon_chain

 

一、術語

1、驗證者(Validator):參與Casper/分片 共識系統的參與者。你可以通過將32 ETH存入這個Casper機制而成為一名驗證者。

2、活躍驗證者集(Active validator set):指那些正在參與的驗證者,Casper機制希望產生并證明區塊、“交叉鏈接”以及其它共識對象;

3、委員會(Committee):活躍驗證者集的一個(偽)隨機抽樣子集。當一個委員會被集體選出時,正如“這個委員會證明了X”一樣,這就意味著,該委員會的一些子集,包含了足夠的驗證者,以致協議承認它代表著該委員會。

4、提出者(Proposer):創建區塊的驗證者;

5、證明者(Attester):它是委員會的驗證成員,其需要在一個區塊上進行簽名操作;

6、Beacon鏈(Beacon chain):分片系統的基礎,即核心PoS鏈;

7、分片鏈(Shard chain):交易所發生的鏈之一,并用于存儲賬戶數據;

8、交聯(Crosslink):一組來自委員會的簽名,其可證明一個分片鏈中的區塊,它們可以被包含在beacon鏈當中。交聯是beacon鏈“了解”分片鏈更新狀態的主要手段;

9、Slot:SLOT_DURATION周期時間,在此期間,一個提出者有能力創建一個區塊,而某些證明者能夠進行證明工作;

10、朝代變遷(Dynasty transition):驗證者集的變化;

11、朝代(Dynasty):自創世以來,在給定鏈中發生的朝代變遷的數量;

12、周期(Cycle):在這個時期內,所有驗證者都有一次投票的機會(除非一個朝代的轉變發生在內部)

13、完成區塊及合理區塊(Finalized,?justified),見Casper FFG定稿:https://arxiv.org/abs/1710.09437

14、取款周期(Withdrawal period):驗證者退出與驗證者余額可取款之間的slot數量;

15、創始時間(Genesis time):beacon鏈在slot 為0時的創始區塊UNIX時間;

二、常量

P1驗證者狀態碼:

P1

特殊記錄類型:

p2

驗證者集增量標志:

p3

 

三、PoW主鏈注冊合約

以太坊2.0的初始部署階段,是不需要對PoW鏈進行共識更改的。相反的是,我們會向PoW鏈添加一個注冊合約,以存入ETH。這個合約有一個注冊函數,它采用了pubkey,?withdrawal_shard,?withdrawal_address,?randao_commitment?這些參數,正如下面的ValidatorRecord中所定義。

這個注冊合約會通過beacon鏈發出一個帶有各種參數的日志。它不會進行驗證,而是把注冊邏輯發送給beacon鏈。需要注意的是,注冊合約不會去驗證占有證明(基于BLS12-381曲線)。

 

四、Beacon 鏈數據結構

Beacon鏈是PoS系統的“主鏈”,beacon鏈的主要職責是:

  1. 存儲并維護活躍、列隊等待以及退出驗證者的集合;
  2. 處理交聯(見上文);
  3. 處理逐塊一致性,以及最終小工具(finality gadget);

4、1 ? Beacon 鏈區塊

一個BeaconBlock具有以下字段:

{
# Slot number
'slot': 'int64',
# Proposer RANDAO reveal
'randao_reveal': 'hash32',
# Recent PoW chain reference (block hash)
'pow_chain_reference': 'hash32',
# Skip list of ancestor block hashes (i'th item is 2**i'th ancestor (or zero) for i = 0, ..., 31)
'ancestor_hashes': ['hash32'],
# Active state root
'active_state_root': 'hash32',
# Crystallized state root
'crystallized_state_root': 'hash32',
# Attestations
'attestations': [AttestationRecord],
# Specials (e.g. logouts, penalties)
'specials': [SpecialRecord]
}

 

一個AttestationRecord具有以下字段:

{
    # Slot number
    'slot': 'int64',
    # Shard number
    'shard': 'int16',
    # Block hashes not part of the current chain, oldest to newest
    'oblique_parent_hashes': ['hash32'],
    # Shard block hash being attested to
    'shard_block_hash': 'hash32',
    # Attester participation bitfield (1 bit per attester)
    'attester_bitfield': 'bytes',
    # Slot of last justified block
    'justified_slot': 'int64',
    # Hash of last justified block
    'justified_block_hash': 'hash32',
    # BLS aggregate signature
    'aggregate_sig': ['int256']
}

一個AttestationSignedData具有以下字段:

{
    # Chain version
    'version': 'int64',
    # Slot number
    'slot': 'int64',
    # Shard number
    'shard': 'int16',
    # 31 parent hashes
    'parent_hashes': ['hash32'],
    # Shard block hash
    'shard_block_hash': 'hash32',
    # Slot of last justified block referenced in the attestation
    'justified_slot': 'int64'
}

一個SpecialRecord具有以下字段:

{
    # Kind
    'kind': 'int8',
    # Data
    'data': ['bytes']
}

4、2 ?Beacon鏈狀態

beacon鏈狀態分為了活躍狀態(active state )和結晶狀態(crystallized state)這兩個部分;下面是活躍狀態ActiveState具有的字段:

{
    # Attestations not yet processed
    'pending_attestations': [AttestationRecord],
    # Specials not yet been processed
    'pending_specials': [SpecialRecord]
    # Most recent 2 * CYCLE_LENGTH block hashes, older to newer
    'recent_block_hashes': ['hash32'],
    # RANDAO state
    'randao_mix': 'hash32'
}

下面是結晶狀態CrystallizedState具有的字段:

{
    # Dynasty number
    'dynasty': 'int64',
    # Dynasty seed (from randomness beacon)
    'dynasty_seed': 'hash32',
    # Dynasty start
    'dynasty_start_slot': 'int64',
    # List of validators
    'validators': [ValidatorRecord],
    # Most recent crosslink for each shard
    'crosslinks': [CrosslinkRecord],
    # Last crystallized state recalculation
    'last_state_recalculation_slot': 'int64',
    # Last finalized slot
    'last_finalized_slot': 'int64',
    # Last justified slot
    'last_justified_slot': 'int64',
    # Number of consecutive justified slots
    'justified_streak': 'int64',
    # Committee members and their assigned shard, per slot
    'shard_and_committee_for_slots': [[ShardAndCommittee]],
    # Total deposits penalized in the given withdrawal period
    'deposits_penalized_in_period': ['int32'],
    # Hash chain of validator set changes (for light clients to easily track deltas)
    'validator_set_delta_hash_chain': 'hash32'
    # Parameters relevant to hard forks / versioning.
    # Should be updated only by hard forks.
    'pre_fork_version': 'int32',
    'post_fork_version': 'int32',
    'fork_slot_number': 'int64',
}

一個ValidatorRecord具有以下字段:

{
    # BLS public key
    'pubkey': 'int256',
    # Withdrawal shard number
    'withdrawal_shard': 'int16',
    # Withdrawal address
    'withdrawal_address': 'address',
    # RANDAO commitment
    'randao_commitment': 'hash32',
    # Balance
    'balance': 'int64',
    # Status code
    'status': 'int8',
    # Slot when validator exited (or 0)
    'exit_slot': 'int64'
}

一個CrosslinkRecord具有以下字段:

{
    # Dynasty number
    'dynasty': 'int64',
    # Slot number
    'slot': 'int64',
    # Beacon chain block hash
    'shard_block_hash': 'hash32'
}

一個ShardAndCommittee 對象具有以下字段:

fields = {
# The shard ID
'shard_id': 'int16',
# Validator indices
'committee': ['int24']
}

4、3 ?Beacon鏈的處理

處理beacon鏈,在很多方面與處理PoW鏈有著相似之處。例如客戶端下載、處理區塊,維護當前的“權威鏈”,并終止于當前“頭部”。然而,由于beacon鏈與現有PoW鏈之間的關系,并且beacon鏈是一種PoS鏈,兩者還是有很大不同的。

對于beacon鏈上節點所處理的區塊,必須要滿足3個條件:

  1. 由ancestor_hashes[0]指向的父對象已被處理及接受。
  2. 由pow_chain_ref所指向的PoW鏈區塊已被處理及接受;
  3. 節點的本地時間大于或等于由GENESIS_TIME + slot_number * SLOT_DURATION 計算得出的最小時間戳;

如果不滿足這三個條件,則客戶端應延遲處理區塊,直到滿足這幾個條件為止。在區塊生產方面,由于PoS機制的原因,beacon鏈顯然與PoW鏈存在著顯著差異。客戶端應檢查權威鏈應該在什么時候創建區塊,并查找它的slot(類似高度)數;當slot到達時,它會根據要求提出或證明一個區塊;

4、4。Beacon鏈分叉選擇規則

beacon鏈使用了Casper FFG分叉選擇規則,即“支持包含最高合理檢查點(highest-epoch justified checkpoint)的區塊鏈”。為了從相同合理檢查點派生而出的兩條鏈之間進行選擇,區塊鏈會使用即時消息驅動GHOST(IMD GHOST)方案來選擇出權威鏈 。具體描述參見:https://ethresear.ch/t/beacon-chain-casper-ffg-rpj-mini-spec/2760

相關模擬實現代碼庫,請參見:

https://github.com/ethereum/research/blob/master/clock_disparity/ghost_node.py

下圖展示了系統工作的一個例子(綠色是完成區塊,黃色代表合理區塊,灰色代表證明):

p5

 

五、Beacon鏈狀態轉移函數

我們現在定義一下狀態轉移函數。從高層次講,狀態轉換由兩個部分組成:

  1. 結晶狀態重計算,這只有當block.slot_number >= last_state_recalc + CYCLE_LENGTH?時才會發生,而它會影響CrystallizedState以及ActiveState;
  2. 每區塊處理(per-block processing),它發生在每個區塊,并且其只影響ActiveState;

結晶狀態重計算通常集中于對驗證者集的更改,包括調整余額,添加和刪除驗證者,以及處理交聯( crosslink)和設置FFG檢查點,而每區塊處理通常集中于驗證聚合簽名并保存與ActiveState區塊內活動有關的臨時記錄。 

5、1 ?輔助函數(Helper functions)

我們首先定義一些輔助算法。首先是,選擇活躍驗證者的函數:

def get_active_validator_indices(validators):
    return [i for i, v in enumerate(validators) if v.status == ACTIVE]

接下來是洗牌這個列表的函數:

def shuffle(lst, seed):
    # entropy is consumed in 3 byte chunks
    # rand_max is defined to remove the modulo bias from this entropy source
    rand_max = 2**24
    assert len(lst) <= rand_max

o = [x for x in lst] source = seed i = 0 while i < len(lst): source = hash(source) for pos in range(0, 30, 3): m = int.from_bytes(source[pos:pos+3], ‘big’) remaining = len(lst) – i if remaining == 0: break rand_max = rand_max – rand_max % remaining if m < rand_max: replacement_pos = (m % remaining) + i o[i], o[replacement_pos] = o[replacement_pos], o[i] i += 1 return o

下面是一個將列表拆分成N塊的函數:

def split(lst, N):
    return [lst[len(lst)*i//N: len(lst)*(i+1)//N] for i in range(N)]

 

接下來,是我們的組合輔助函數:

def get_new_shuffling(seed, validators, crosslinking_start_shard):
    active_validators = get_active_validator_indices(validators)
    if len(active_validators) >= CYCLE_LENGTH * MIN_COMMITTEE_SIZE:
        committees_per_slot = min(len(active_validators) // CYCLE_LENGTH // (MIN_COMMITTEE_SIZE * 2) + 1, SHARD_COUNT // CYCLE_LENGTH)
        slots_per_committee = 1
    else:
        committees_per_slot = 1
        slots_per_committee = 1
        while len(active_validators) * slots_per_committee < CYCLE_LENGTH * MIN_COMMITTEE_SIZE \
                and slots_per_committee < CYCLE_LENGTH:
            slots_per_committee *= 2
    o = []
    for i, slot_indices in enumerate(split(shuffle(active_validators, seed), CYCLE_LENGTH)):
        shard_indices = split(slot_indices, committees_per_slot)
        shard_start = crosslinking_start_shard + \
            i * committees_per_slot // slots_per_committee
        o.append([ShardAndCommittee(
            shard = (shard_start + j) % SHARD_COUNT,
            committee = indices
        ) for j, indices in enumerate(shard_indices)])
    return o

下面是一個關于正在發生的圖解:?p5我們還定義了兩個函數:

def get_shards_and_committees_for_slot(crystallized_state, slot):
    earliest_slot_in_array = crystallized_state.last_state_recalculation_slot - CYCLE_LENGTH
    assert earliest_slot_in_array <= slot < earliest_slot_in_array + CYCLE_LENGTH * 2
    return crystallized_state.shard_and_committee_for_slots[slot - earliest_slot_in_array]

def get_block_hash(active_state, curblock, slot): earliest_slot_in_array = curblock.slot – CYCLE_LENGTH * 2 assert earliest_slot_in_array <= slot < earliest_slot_in_array + CYCLE_LENGTH * 2 return active_state.recent_block_hashes[slot – earliest_slot_in_array]


 

其中get_block_hash(_, _, s)應該始終以slot?s返回鏈中的區塊,而get_shards_and_committees_for_slot(_, s)則不應該改變,除非朝代(dynasty)發生改變。我們還定義了一個函數,為驗證者哈希鏈“添加了一個link”,這在添加或移除一個驗證者時使用:

def add_validator_set_change_record(crystallized_state, index, pubkey, flag):
    crystallized_state.validator_set_delta_hash_chain = \
        hash(crystallized_state.validator_set_delta_hash_chain +
             bytes1(flag) + bytes3(index) + bytes32(pubkey))

最后,我們抽象地將用于獎勵/懲罰計算的int_sqrt(n)定義為最大整數k,使得k**2<=n:

def int_sqrt(n):
    x = n
    y = (x + 1) // 2
    while y < x:
        x = y
        y = (x + n // x) // 2
    return x

5、2 關于啟動(On startup)

運行以下代碼:

 
def on_startup(initial_validator_entries):
    # Induct validators
    validators = []
    for pubkey, proof_of_possession, withdrawal_shard, withdrawal_address, \
            randao_commitment in initial_validator_entries:
        add_validator(validators, pubkey, proof_of_possession,
                      withdrawal_shard, withdrawal_address, randao_commitment)
    # Setup crystallized state
    cs = CrystallizedState()
    x = get_new_shuffling(bytes([0] * 32), validators, 0)
    cs.shard_and_committee_for_slots = x + x
    cs.dynasty = 1
    cs.crosslinks = [CrosslinkRecord(dynasty=0, slot=0, hash=bytes([0] * 32))
                            for i in range(SHARD_COUNT)]
    # Setup active state
    as = ActiveState()
    as.recent_block_hashes = [bytes([0] * 32) for _ in range(CYCLE_LENGTH * 2)]

CrystallizedState()和ActiveState()構造函數應根據上下文將所有值初始化為零字節、空值或空數組。add_validator程序定義如下:

 
def add_validator(validators, pubkey, proof_of_possession, withdrawal_shard,
                  withdrawal_address, randao_commitment):
    # if following assert fails, validator induction failed
    # move on to next validator registration log
    assert BLSVerify(pub=pubkey,
                     msg=hash(pubkey),
                     sig=proof_of_possession)
    rec = ValidatorRecord(
        pubkey=pubkey,
        withdrawal_shard=withdrawal_shard,
        withdrawal_address=withdrawal_address,
        randao_commitment=randao_commitment,
        balance=DEPOSIT_SIZE * GWEI_PER_ETH, # in Gwei
        status=PENDING_ACTIVATION,
        exit_slot=0
    )
    index = min_empty_validator(validators)
    if index is None:
        validators.append(rec)
        return len(validators) - 1
    else:
        validators[index] = rec
        return index

5、3 每區塊處理(Per-block processing)

這個程序應該在每個區塊上執行。

首先,將recent_block_hashes設置為以下輸出,其中parent_hash是前一個區塊的哈希:

def get_new_recent_block_hashes(old_block_hashes, parent_slot,
                                current_slot, parent_hash):
    d = current_slot - parent_slot
    return old_block_hashes[d:] + [parent_hash] * min(d, len(old_block_hashes))

get_block_hash的輸出不應該改變,除非它不再 throw for?current_slot – 1,而是 throw for?current_slot – CYCLE_LENGTH * 2 – 1此外,使用以下算法檢查區塊的ancestor_hashes數組是否被正確更新:

def update_ancestor_hashes(parent_ancestor_hashes, parent_slot_number, parent_hash):
    new_ancestor_hashes = copy.copy(parent_ancestor_hashes)
    for i in range(32):
        if parent_slot_number % 2**i == 0:
            new_ancestor_hashes[i] = parent_hash
    return new_ancestor_hashes

區塊可以有0個或多個AttestationRecord對象,其中每個AttestationRecord對象具有以下字段:

fields = {
    # Slot number
    'slot': 'int64',
    # Shard ID
    'shard_id': 'int16',
    # List of block hashes that this signature is signing over that
    # are NOT part of the current chain, in order of oldest to newest
    'oblique_parent_hashes': ['hash32'],
    # Block hash in the shard that we are attesting to
    'shard_block_hash': 'hash32',
    # Who is participating
    'attester_bitfield': 'bytes',
    # The actual signature
    'aggregate_sig': ['int256']
}

對于這些證明中的每一個:

  1. 驗證slot <= parent.slot?以及slot >= max(parent.slot – CYCLE_LENGTH + 1, 0);
  2. 驗證給定鏈中的justified_slot以及justified_block_hash等于或早于結晶狀態的last_justified_slot
  3. 計算parent_hashes = [get_block_hash(crystallized_state, active_state, block, slot – CYCLE_LENGTH + i) for i in range(CYCLE_LENGTH – len(oblique_parent_hashes))] + oblique_parent_hashes
  4. 讓?attestation_indices成為?get_indices_for_slot(crystallized_state, active_state, slot)[x],選擇?x?那么?attestation_indices.shard_id?就等于 所提供的?shard值,以找到創建證明記錄的驗證者集;
  5. 驗證len(attester_bitfield) == ceil_div8(len(attestation_indices)), 其中ceil_div8 = (x + 7) // 8. 驗證位len(attestation_indices)…. 以及更高的, 如果出現的 (i.e. len(attestation_indices)結果不是8的倍數), 則所有為0
  6. 讓?version = pre_fork_version if slot < fork_slot_number else post_fork_version.
  7. 使用生成的公鑰組以及序列化形式的AttestationSignedData(version, slot, shard, parent_hashes, shard_block_hash, justified_slot)?驗證?aggregate_sig;

5、4 狀態重計算

當slot – last_state_recalc >= CYCLE_LENGTH時進行重復過程;對于所有?last_state_recalc – CYCLE_LENGTH … last_state_recalc – 1范圍中的slot?s;

  1. 確定至少為該區塊投票的驗證者的總集合;
  2. 確定這些驗證者的總余額,如果該值乘以3等于或超過所有活躍驗證者乘以2的總余額,則設置 last_justified_slot = max(last_justified_slot, s) 以及 justified_streak += 1。否則,則設置justified_streak = 0;
  3. 如果justified_streak >= CYCLE_LENGTH + 1,則設置last_finalized_slot = max(last_finalized_slot, s – CYCLE_LENGTH – 1);
  4. 刪除所有比 last_state_recalc slot更早的證明記錄;

還有:1、設置last_state_recalc += CYCLE_LENGTH; 2、設置indices_for_slots[:CYCLE_LENGTH] = indices_for_slots[CYCLE_LENGTH:];

對于所有(shard_id, shard_block_hash) 元組,計算為該分片區塊哈希投票的驗證者總存款大小。如果該值乘以3等于或超過委員會中所有驗證者的總余額乘以2,并且當前朝代(dynasty)超過crosslink_records[shard_id].dynasty,則設置crosslink_records[shard_id] = CrosslinkRecord(dynasty=current_dynasty, hash=shard_block_hash);

待辦事項:

  1. FFG參與獎勵;
  2. 委員會參與獎勵;

六、朝代變遷(Dynasty transition)

如果滿足下列所有標準,則在狀態重新計算之后發生了朝代變遷: 

  1. block.slot – crystallized_state.dynasty_start_slot >= MIN_DYNASTY_LENGTH
  2. last_finalized_slot > dynasty_start_slot
  3. 對于shard_and_committee_for_slots中的每一個shard分片數,crosslinks[shard].slot > dynasty_start_slot

然后,運行下面的算法來更新驗證者集合:

 
def change_validators(validators):
    # The active validator set
    active_validators = get_active_validator_indices(validators, dynasty)
    # The total balance of active validators
    total_balance = sum([v.balance for i, v in enumerate(validators) if i in active_validators])
    # The maximum total wei that can deposit+withdraw
    max_allowable_change = max(
        2 * DEPOSIT_SIZE GWEI_PER_ETH,
        total_balance // MAX_VALIDATOR_CHURN_QUOTIENT
    )
    # Go through the list start to end depositing+withdrawing as many as possible
    total_changed = 0
    for i in range(len(validators)):
        if validators[i].status == PENDING_ACTIVATION:
            validators[i].status = ACTIVE
            total_changed += DEPOSIT_SIZE
            add_validator_set_change_record(crystallized_state, i, validators[i].pubkey, ENTRY)
        if validators[i].status == PENDING_EXIT:
            validators[i].status = PENDING_WITHDRAW
            validators[i].exit_slot = current_slot
            total_changed += validators[i].balance
            add_validator_set_change_record(crystallized_state, i, validators[i].pubkey, EXIT)
        if total_changed >= max_allowable_change:
            break

# Calculate the total ETH that has been penalized in the last ~2-3 withdrawal periods period_index = current_slot // WITHDRAWAL_PERIOD total_penalties = ( (crystallized_state.deposits_penalized_in_period[period_index]) + (crystallized_state.deposits_penalized_in_period[period_index – 1] if period_index >= 1 else 0) + (crystallized_state.deposits_penalized_in_period[period_index – 2] if period_index >= 2 else 0) ) # Separate loop to withdraw validators that have been logged out for long enough, and # calculate their penalties if they were slashed for i in range(len(validators)): if validators[i].status in (PENDING_WITHDRAW, PENALIZED) and current_slot >= validators[i].exit_slot + WITHDRAWAL_PERIOD: if validators[i].status == PENALIZED: validators[i].balance -= validators[i].balance * min(total_penalties * 3, total_balance) // total_balance validators[i].status = WITHDRAWN


withdraw_amount = validators[i].balance … # STUB: withdraw to shard chain

最后:

  1. 設置 last_dynasty_start_slot = crystallized_state.last_state_recalculation_slot
  2. 設置 crystallized_state.dynasty += 1
  3. 設置 next_start_shard = (shard_and_committee_for_slots[-1][-1].shard + 1) % SHARD_COUNT
  4. 設置 shard_and_committee_for_slots[CYCLE_LENGTH:] = get_new_shuffling(active_state.randao_mix, validators, next_start_shard)

七、尚未完成的工作

注:這個項目的完成度大約為60%,所缺少的主要部分為:

  1. 具體如何構造 crystallized_state_root以及active_state_root,包括用于輕客戶端的默克爾化證明;
  2. 關于pow_chain_reference可接受值的具體規則;
  3. 關于分片鏈區塊、提出者等具體規則;
  4. 關于強制撤銷登記的具體規則;
  5. 關于(全局時鐘、網絡延遲、驗證者誠實、驗證者活躍度等)問題的各種假設;
  6. 關于監護證明的邏輯,包括削減條件;
  7. 添加BLS12-381曲線的附錄;
  8. 添加gossip網絡以及鏈外簽名聚合邏輯的附錄;
  9. 添加一個詞匯表(在單獨的詞匯表中),以全面而準確地定義所有術語;
  10. 進行同行評審、安全審核和形式驗證;

可能的修訂/增補 工作

  1. 用LMD替換IMD分叉選擇規則;
  2. 將crystallized_state_root?以及?active_state_root?默克爾化成一個單獨的根;
  3. 用一個對STARK友好的哈希函數替換掉Blake;
  4. 去掉朝代(dynasties)的概念;
  5. 將slot直接換成8秒;
  6. 允許延遲聚合簽名的包含;
  7. 引入一種RANDAO削減條件;
  8. 對于占有證明,使用一種單獨的哈希函數;
  9. 修改ShardAndCommittee數據結構;
  10. 為歷史beacon鏈區塊添加一個雙批(double-batched)的默克爾累加器;
  11. 允許存款大于32ETH,并設置存款上限;
  12. 對于存款低于32ETH(或其它閾值)的情況,設置一個罰金;
  13. 為寄存器添加一個SpecialRecord;
  14. 重寫文檔可讀性;
  15. 清楚地記錄各種邊緣情況,例如委員會的大小;
贊(0)

評論 搶沙發

  • 昵稱 (必填)
  • 郵箱 (必填)
  • 網址
p3试机号99