diff --git a/apps/el-gen/genesis_besu.py b/apps/el-gen/genesis_besu.py index 89e2efd..ff49e2f 100644 --- a/apps/el-gen/genesis_besu.py +++ b/apps/el-gen/genesis_besu.py @@ -149,6 +149,11 @@ # Add alloc entry to output's alloc field out["alloc"][addr] = alloc_entry -out['config']['pragueTime'] = int(data['genesis_timestamp']) + int(data['genesis_delay']) + (int(data['electra_fork_epoch']) * ( 32 if data['preset_base']=='mainnet' else 8 ) * int(data['slot_duration_in_seconds'])) +if 'electra_fork_epoch' in data: + out['config']['pragueTime'] = \ + int(data['genesis_timestamp']) + \ + int(data['genesis_delay']) + \ + (int(data['electra_fork_epoch']) * ( 32 if data['preset_base']=='mainnet' else 8 ) * int(data['slot_duration_in_seconds'])) + out['config']['ethash'] = {} print(json.dumps(out, indent=' ')) diff --git a/apps/el-gen/genesis_chainspec.py b/apps/el-gen/genesis_chainspec.py index 82e272c..faa2846 100644 --- a/apps/el-gen/genesis_chainspec.py +++ b/apps/el-gen/genesis_chainspec.py @@ -190,5 +190,11 @@ # Add alloc entry to output's alloc field out["accounts"][addr] = alloc_entry -out['params']['eip6800TransitionTimestamp']= hex(int(data['genesis_timestamp']) + int(data['genesis_delay']) + (int(data['electra_fork_epoch']) * ( 32 if data['preset_base']=='mainnet' else 8 ) * int(data['slot_duration_in_seconds']))) +if 'electra_fork_epoch' in data: + out['params']['eip6800TransitionTimestamp']= hex( + int(data['genesis_timestamp']) + + int(data['genesis_delay']) + + int(data['electra_fork_epoch']) * ( 32 if data['preset_base']=='mainnet' else 8 ) * int(data['slot_duration_in_seconds']) + ) + print(json.dumps(out, indent=' ')) diff --git a/apps/el-gen/genesis_geth.py b/apps/el-gen/genesis_geth.py index f14fdf6..be9cf19 100644 --- a/apps/el-gen/genesis_geth.py +++ b/apps/el-gen/genesis_geth.py @@ -148,5 +148,10 @@ # Add alloc entry to output's alloc field out["alloc"][addr] = alloc_entry -out['config']['pragueTime'] = int(data['genesis_timestamp']) + int(data['genesis_delay']) + (int(data['electra_fork_epoch']) * ( 32 if data['preset_base']=='mainnet' else 8 ) * int(data['slot_duration_in_seconds'])) +if 'electra_fork_epoch' in data: + out['config']['pragueTime'] = \ + int(data['genesis_timestamp']) + \ + int(data['genesis_delay']) + \ + int(data['electra_fork_epoch']) * ( 32 if data['preset_base']=='mainnet' else 8 ) * int(data['slot_duration_in_seconds']) + print(json.dumps(out, indent=' '))