Skip to content

Commit

Permalink
Merge pull request #606 from blxdyx/upstream
Browse files Browse the repository at this point in the history
Upstream for qa issue
  • Loading branch information
setunapo authored Feb 10, 2025
2 parents 00269a1 + 22965ac commit 46b7f6b
Show file tree
Hide file tree
Showing 23 changed files with 566 additions and 466 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ make DIST=/opt/erigon install
### Run local devnet
<code> 🔬 Detailed explanation is [here](/DEV_CHAIN.md).</code>
<code> 🔬 Detailed explanation is [here](/docs/DEV_CHAIN.md).</code>
### Docker permissions error
Expand Down
4 changes: 4 additions & 0 deletions cl/clparams/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,8 @@ func sepoliaConfig() BeaconChainConfig {
cfg.CapellaForkVersion = 0x90000072
cfg.DenebForkEpoch = 132608
cfg.DenebForkVersion = 0x90000073
cfg.ElectraForkEpoch = 222464
cfg.ElectraForkVersion = 0x90000074
cfg.TerminalTotalDifficulty = "17000000000000000"
cfg.DepositContractAddress = "0x7f02C3E3c98b133055B8B348B2Ac625669Ed295D"
cfg.InitializeForkSchedule()
Expand All @@ -930,6 +932,8 @@ func holeskyConfig() BeaconChainConfig {
cfg.CapellaForkVersion = 0x04017000
cfg.DenebForkEpoch = 29696
cfg.DenebForkVersion = 0x05017000
cfg.ElectraForkEpoch = 115968
cfg.ElectraForkVersion = 0x06017000
cfg.TerminalTotalDifficulty = "0"
cfg.TerminalBlockHash = [32]byte{}
cfg.TerminalBlockHashActivationEpoch = math.MaxUint64
Expand Down
2 changes: 1 addition & 1 deletion cmd/caplin/caplin1/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ func RunCaplinService(ctx context.Context, engine execution_client.ExecutionEngi
return err
}
}
stateSnapshots := snapshotsync.NewCaplinStateSnapshots(ethconfig.BlocksFreezing{}, beaconConfig, dirs, snapshotsync.MakeCaplinStateSnapshotsTypes(indexDB), logger)
stateSnapshots := snapshotsync.NewCaplinStateSnapshots(ethconfig.BlocksFreezing{ChainName: beaconConfig.ConfigName}, beaconConfig, dirs, snapshotsync.MakeCaplinStateSnapshotsTypes(indexDB), logger)
antiq := antiquary.NewAntiquary(ctx, blobStorage, genesisState, vTables, beaconConfig, dirs, snDownloader, indexDB, stateSnapshots, csn, rcsn, syncedDataManager, logger, config.ArchiveStates, config.ArchiveBlocks, config.ArchiveBlobs, config.SnapshotGenerationEnabled, snBuildSema)
// Create the antiquary
go func() {
Expand Down
11 changes: 7 additions & 4 deletions consensus/aura/aura.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ func epochTransitionFor(chain consensus.ChainHeaderReader, e *NonTransactionalEp
type AuRa struct {
e *NonTransactionalEpochReader
exitCh chan struct{}
signerMutex sync.RWMutex // Protects the signer fields
signerMutex sync.Mutex // Protects the signer fields

step PermissionedStep
// History of step hashes recently received from peers.
Expand All @@ -241,7 +241,7 @@ type AuRa struct {
EpochManager *EpochManager // Mutex<EpochManager>,

certifier *libcommon.Address // certifies service transactions
certifierLock sync.RWMutex
certifierLock sync.Mutex
}

func NewAuRa(spec *chain.AuRaConfig, db kv.RwDB) (*AuRa, error) {
Expand Down Expand Up @@ -1008,8 +1008,11 @@ func (c *AuRa) SealHash(header *types.Header) libcommon.Hash {
// See https://openethereum.github.io/Permissioning.html#gas-price
// This is thread-safe: it only accesses the `certifier` which is used behind a RWLock
func (c *AuRa) IsServiceTransaction(sender libcommon.Address, syscall consensus.SystemCall) bool {
c.certifierLock.RLock()
defer c.certifierLock.RUnlock()
c.certifierLock.Lock()
defer c.certifierLock.Unlock()
if c.certifier == nil && c.cfg.Registrar != nil {
c.certifier = getCertifier(*c.cfg.Registrar, syscall)
}
if c.certifier == nil {
return false
}
Expand Down
2 changes: 2 additions & 0 deletions consensus/clique/clique.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,8 @@ func (c *Clique) Seal(chain consensus.ChainHeaderReader, blockWithReceipts *type
// For 0-period chains, refuse to seal empty blocks (no reward but would spin sealing)
if c.config.Period == 0 && len(block.Transactions()) == 0 {
c.logger.Info("Sealing paused, waiting for transactions")
results <- nil

return nil
}
// Don't hold the signer fields for the entire sealing procedure
Expand Down
21 changes: 19 additions & 2 deletions core/forkid/forkid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,27 @@ func TestCreation(t *testing.T) {
{2990907, 1677557076, ID{Hash: checksumToBytes(0xb96cbd13), Next: 1677557088}}, // Last pre-Shanghai block
{2990908, 1677557088, ID{Hash: checksumToBytes(0xf7f9bc08), Next: 1706655072}}, // First Shanghai block
{5187022, 1706655060, ID{Hash: checksumToBytes(0xf7f9bc08), Next: 1706655072}}, // Last Shanghai block
{5187023, 1706655072, ID{Hash: checksumToBytes(0x88cf81d9), Next: 0}}, // First Cancun block
{8000000, 1800000000, ID{Hash: checksumToBytes(0x88cf81d9), Next: 0}}, // Future Cancun block (mock)
{5187023, 1706655072, ID{Hash: checksumToBytes(0x88cf81d9), Next: 1741159776}}, // First Cancun block
{7844466, 1741159764, ID{Hash: checksumToBytes(0x88cf81d9), Next: 1741159776}}, // Last Cancun block (approx)
{7844467, 1741159776, ID{Hash: checksumToBytes(0xed88b5fd), Next: 0}}, // First Prague block (approx)
{12000000, 1800000000, ID{Hash: checksumToBytes(0xed88b5fd), Next: 0}}, // Future Prague block (mock)
},
},

// Holesky test cases
{
params.HoleskyChainConfig,
params.HoleskyGenesisHash,
[]testcase{
{0, 1696000704, ID{Hash: checksumToBytes(0xfd4f016b), Next: 1707305664}}, // First Shanghai block
{0, 1707305652, ID{Hash: checksumToBytes(0xfd4f016b), Next: 1707305664}}, // Last Shanghai block
{894733, 1707305676, ID{Hash: checksumToBytes(0x9b192ad0), Next: 1740434112}}, // First Cancun block
{3655435, 1740434100, ID{Hash: checksumToBytes(0x9b192ad0), Next: 1740434112}}, // Last Cancun block (approx)
{3655436, 1740434112, ID{Hash: checksumToBytes(0xdfbd9bed), Next: 0}}, // First Prague block (approx)
{8000000, 1800000000, ID{Hash: checksumToBytes(0xdfbd9bed), Next: 0}}, // Future Prague block (mock)
},
},

// Gnosis test cases
{
params.GnosisChainConfig,
Expand Down
Loading

0 comments on commit 46b7f6b

Please sign in to comment.