Mumbai: fix fork ID for Agra (#8630)

otherwise we start losing maticnetwork/bor peers on devp2p
This commit is contained in:
Andrew Ashikhmin 2023-10-31 10:35:53 +01:00 committed by GitHub
parent d8d7d8d5df
commit cabd2b21dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View File

@ -244,6 +244,10 @@ func GatherForks(config *chain.Config, genesisTime uint64) (heightForks []uint64
heightForks = append(heightForks, *config.Aura.PosdaoTransition)
}
if config.Bor != nil && config.Bor.AgraBlock != nil {
heightForks = append(heightForks, config.Bor.AgraBlock.Uint64())
}
// Sort the fork block numbers & times to permit chronological XOR
slices.Sort(heightForks)
slices.Sort(timeForks)

View File

@ -141,6 +141,18 @@ func TestCreation(t *testing.T) {
{4100419, 1684934220, ID{Hash: checksumToBytes(0xa15a4252), Next: 0}}, // First Shanghai block
},
},
// Mumbai test cases
{
params.MumbaiChainConfig,
params.MumbaiGenesisHash,
[]testcase{
{0, 0, ID{Hash: checksumToBytes(0xf6ef3fdf), Next: 2722000}},
{2722000, 0, ID{Hash: checksumToBytes(0x8647df30), Next: 13996000}}, // First Istanbul block
{13996000, 0, ID{Hash: checksumToBytes(0x06cc1179), Next: 22640000}}, // First Berlin block
{22640000, 0, ID{Hash: checksumToBytes(0x9adf950e), Next: 41874000}}, // First London block
{41874000, 0, ID{Hash: checksumToBytes(0x0c015a91), Next: 0}}, // First Agra block
},
},
}
for i, tt := range tests {
for j, ttt := range tt.cases {