Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit dc6abda

Browse files
vubvub
authored andcommitted
Merge branch 'state_revamp' of github.com:ethereum/pyethereum into state_revamp
2 parents 77196e4 + f6efb7c commit dc6abda

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

ethereum/casper_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def get_casper_ct():
6666
class RandaoManager():
6767

6868
def __init__(self, seed, rounds=10**4+1):
69-
self.medstate = []
69+
self.medstate = []
7070
for i in range(rounds):
7171
if not i % RANDAO_SAVE_INTERVAL:
7272
self.medstate.append(seed)

ethereum/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
DAO_WITHDRAWER = utils.normalize_address('0xbf4ed7b27f1d666546e30d74d50d173d20bca754'),
6464
# Header validation: ethereum 1.0, contract
6565
HEADER_VALIDATION = 'ethereum1',
66-
# Post-seal finalization: ethereum 1.0, contract
66+
# Pre-seal finalization: ethereum 1.0, contract
6767
FINALIZATION = 'ethereum1',
6868
# Default consensus strategy: ethash, poa, casper, pbft
6969
CONSENSUS_STRATEGY = 'ethereum1',

ethereum/state_transition.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ def pre_seal_finalize(state, block):
7878
state.delta_balance(uncle.coinbase, r)
7979
if state.block_number - state.config['MAX_UNCLE_DEPTH'] in state.recent_uncles:
8080
del state.recent_uncles[state.block_number - state.config['MAX_UNCLE_DEPTH']]
81+
elif state.config['FINALIZATION'] == 'contract':
82+
pass
83+
else:
84+
raise Exception("Pre-seal finalization strategy %s not supported " % state.config['FINALIZATION'])
85+
8186
state.commit()
8287

8388

0 commit comments

Comments
 (0)