Skip to content

Commit

Permalink
Updated submitter fork addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
Marko Boben committed Feb 20, 2024
1 parent fbe750d commit 2921674
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 21 deletions.
11 changes: 5 additions & 6 deletions avalanchego/coreth/core/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@ import (

var (
// Define activation times for submitter contract
submitterContractActivationTimeSongbird = big.NewInt(time.Date(2024, time.March, 1, 12, 0, 0, 0, time.UTC).Unix())
submitterContractActivationTimeCoston = big.NewInt(time.Date(2024, time.January, 31, 12, 0, 0, 0, time.UTC).Unix())
submitterContractActivationTimeSongbird = big.NewInt(time.Date(2024, time.March, 15, 12, 0, 0, 0, time.UTC).Unix())
submitterContractActivationTimeCoston = big.NewInt(time.Date(2024, time.February, 22, 14, 0, 0, 0, time.UTC).Unix())

// Define ftso and submitter contract addresses
prioritisedFTSOContractAddress = common.HexToAddress("0x1000000000000000000000000000000000000003")

prioritisedSubmitterContractAddressSongbird = common.HexToAddress("0x200000000000000000000000000000000000000a")
prioritisedSubmitterContractAddressCoston = common.HexToAddress("0x300000000000000000000000000000000000000b")
prioritisedSubmitterContractAddress = common.HexToAddress("0x2cA6571Daa15ce734Bbd0Bf27D5C9D16787fc33f")
)

// Define errors
Expand Down Expand Up @@ -88,10 +87,10 @@ func isPrioritisedSubmitterContract(chainID *big.Int, to *common.Address, blockT
case to == nil || chainID == nil || blockTime == nil:
return false
case chainID.Cmp(params.SongbirdChainID) == 0:
return *to == prioritisedSubmitterContractAddressSongbird &&
return *to == prioritisedSubmitterContractAddress &&
blockTime.Cmp(submitterContractActivationTimeSongbird) > 0
case chainID.Cmp(params.CostonChainID) == 0:
return *to == prioritisedSubmitterContractAddressCoston &&
return *to == prioritisedSubmitterContractAddress &&
blockTime.Cmp(submitterContractActivationTimeCoston) > 0
default:
return false
Expand Down
12 changes: 6 additions & 6 deletions avalanchego/coreth/core/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,8 @@ func TestKeeperTriggerShouldNotMintMoreThanLimit(t *testing.T) {

func TestPrioritisedContract(t *testing.T) {
address := common.HexToAddress("0x123456789aBCdEF123456789aBCdef123456789A")
preForkTime := big.NewInt(time.Date(2024, time.February, 1, 12, 0, 0, 0, time.UTC).Unix())
postForkTime := big.NewInt(time.Date(2024, time.March, 2, 12, 0, 0, 0, time.UTC).Unix())
preForkTime := big.NewInt(time.Date(2024, time.March, 13, 12, 0, 0, 0, time.UTC).Unix())
postForkTime := big.NewInt(time.Date(2024, time.March, 16, 12, 0, 0, 0, time.UTC).Unix())
ret0 := [32]byte{}
ret1 := [32]byte{}
ret1[31] = 1
Expand All @@ -466,16 +466,16 @@ func TestPrioritisedContract(t *testing.T) {
if !IsPrioritisedContractCall(params.SongbirdChainID, &prioritisedFTSOContractAddress, nil, preForkTime) {
t.Errorf("Expected true for FTSO contract")
}
if IsPrioritisedContractCall(params.SongbirdChainID, &prioritisedSubmitterContractAddressSongbird, ret1[:], preForkTime) {
if IsPrioritisedContractCall(params.SongbirdChainID, &prioritisedSubmitterContractAddress, ret1[:], preForkTime) {
t.Errorf("Expected false for submitter contract before activation")
}
if !IsPrioritisedContractCall(params.SongbirdChainID, &prioritisedSubmitterContractAddressSongbird, ret1[:], postForkTime) {
if !IsPrioritisedContractCall(params.SongbirdChainID, &prioritisedSubmitterContractAddress, ret1[:], postForkTime) {
t.Errorf("Expected true for submitter contract after activation")
}
if IsPrioritisedContractCall(params.SongbirdChainID, &prioritisedSubmitterContractAddressSongbird, ret0[:], postForkTime) {
if IsPrioritisedContractCall(params.SongbirdChainID, &prioritisedSubmitterContractAddress, ret0[:], postForkTime) {
t.Errorf("Expected false for submitter contract with wrong return value")
}
if IsPrioritisedContractCall(params.SongbirdChainID, &prioritisedSubmitterContractAddressSongbird, nil, postForkTime) {
if IsPrioritisedContractCall(params.SongbirdChainID, &prioritisedSubmitterContractAddress, nil, postForkTime) {
t.Errorf("Expected false for submitter contract with no return value")
}
}
18 changes: 9 additions & 9 deletions avalanchego/coreth/core/state_connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,15 @@ func GetDefaultAttestors(chainID *big.Int, blockTime *big.Int) []common.Address
switch {
case blockTime.Cmp(submitterContractActivationTimeSongbird) > 0:
return []common.Address{
common.HexToAddress("0x2D3e7e4b19bDc920fd9C57BD3072A31F5a59FeC8"),
common.HexToAddress("0x442DD539Fe78D43A1a9358FF3460CfE63e2bC9CC"),
common.HexToAddress("0x49893c5Dfc035F4eE4E46faC014f6D4bC80F7f92"),
common.HexToAddress("0x5D2f75392DdDa69a2818021dd6a64937904c8352"),
common.HexToAddress("0x6455dC38fdF739b6fE021b30C7D9672C1c6DEb5c"),
common.HexToAddress("0x808441Ec3Fa1721330226E69527Bc160D8d9386a"),
common.HexToAddress("0x823B0f5c7758E9d3bE55bA1EA840E29ccd5D5CcB"),
common.HexToAddress("0x85016969b9eBDB8977975a4743c9FCEeabCEAf8A"),
common.HexToAddress("0x8A3D627D86A81F5D21683F4963565C63DB5e1309"),
common.HexToAddress("0xcE397b9a395ace2e328030699bDDf4E2F049A05B"),
common.HexToAddress("0xeDBb013BBC314124a9f842c1887e34cfeB03B052"),
common.HexToAddress("0xb9eF3951ac2D04C6bdD886bF042041E3954E86aF"),
common.HexToAddress("0x816Cec8f3A37Fd673Cfd4229441c59cA8DbD0641"),
common.HexToAddress("0x14c9c4583F0b1af8a69452Ec1b29884240f83bDC"),
common.HexToAddress("0x0049081C2D6def64800cC011Bd9aDe8682c6593a"),
common.HexToAddress("0x53Fcb50a22aFd6e5438d754CB22c4726032d2488"),
common.HexToAddress("0x35f4F0Bb73a6040F24927e1735B089d7769F7674"),
common.HexToAddress("0x3B583C919fD4C863F3A17d11929346C687FfB7c3"),
}
case blockTime.Cmp(songbirdOct22ForkTime) > 0:
return []common.Address{
Expand Down

0 comments on commit 2921674

Please sign in to comment.