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 18a7aee commit f15d6d2
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 21 deletions.
13 changes: 6 additions & 7 deletions coreth/core/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@ import (

var (
// Define activation times for submitter contract
submitterContractActivationTimeFlare = big.NewInt(time.Date(2024, time.March, 1, 12, 0, 0, 0, time.UTC).Unix())
submitterContractActivationTimeCostwo = big.NewInt(time.Date(2024, time.January, 31, 12, 0, 0, 0, time.UTC).Unix())
submitterContractActivationTimeFlare = big.NewInt(time.Date(2024, time.March, 26, 12, 0, 0, 0, time.UTC).Unix())
submitterContractActivationTimeCostwo = big.NewInt(time.Date(2024, time.February, 21, 12, 0, 0, 0, time.UTC).Unix())

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

prioritisedSubmitterContractAddressFlare = common.HexToAddress("0x200000000000000000000000000000000000000a")
prioritisedSubmitterContractAddressCostwo = common.HexToAddress("0x300000000000000000000000000000000000000b")
prioritisedSubmitterContractAddressEnv = common.HexToAddress(os.Getenv("SUBMITTER_CONTRACT_ADDRESS")) // for local and staging chains
prioritisedSubmitterContractAddress = common.HexToAddress("0x2cA6571Daa15ce734Bbd0Bf27D5C9D16787fc33f")
prioritisedSubmitterContractAddressEnv = common.HexToAddress(os.Getenv("SUBMITTER_CONTRACT_ADDRESS")) // for local and staging chains
)

// Define errors
Expand Down Expand Up @@ -98,10 +97,10 @@ func isPrioritisedSubmitterContract(chainID *big.Int, to *common.Address, blockT
case to == nil || chainID == nil || blockTime == nil:
return false
case chainID.Cmp(params.FlareChainID) == 0:
return *to == prioritisedSubmitterContractAddressFlare &&
return *to == prioritisedSubmitterContractAddress &&
blockTime.Cmp(submitterContractActivationTimeFlare) > 0
case chainID.Cmp(params.CostwoChainID) == 0:
return *to == prioritisedSubmitterContractAddressCostwo &&
return *to == prioritisedSubmitterContractAddress &&
blockTime.Cmp(submitterContractActivationTimeCostwo) > 0
case chainID.Cmp(params.LocalFlareChainID) == 0 || chainID.Cmp(params.StagingChainID) == 0:
return *to == prioritisedSubmitterContractAddressEnv
Expand Down
8 changes: 4 additions & 4 deletions coreth/core/daemon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -493,16 +493,16 @@ func TestPrioritisedContract(t *testing.T) {
if !IsPrioritisedContractCall(params.FlareChainID, &prioritisedFTSOContractAddress, nil, preForkTime) {
t.Errorf("Expected true for FTSO contract")
}
if IsPrioritisedContractCall(params.FlareChainID, &prioritisedSubmitterContractAddressFlare, ret1[:], preForkTime) {
if IsPrioritisedContractCall(params.FlareChainID, &prioritisedSubmitterContractAddress, ret1[:], preForkTime) {
t.Errorf("Expected false for submitter contract before activation")
}
if !IsPrioritisedContractCall(params.FlareChainID, &prioritisedSubmitterContractAddressFlare, ret1[:], postForkTime) {
if !IsPrioritisedContractCall(params.FlareChainID, &prioritisedSubmitterContractAddress, ret1[:], postForkTime) {
t.Errorf("Expected true for submitter contract after activation")
}
if IsPrioritisedContractCall(params.FlareChainID, &prioritisedSubmitterContractAddressFlare, ret0[:], postForkTime) {
if IsPrioritisedContractCall(params.FlareChainID, &prioritisedSubmitterContractAddress, ret0[:], postForkTime) {
t.Errorf("Expected false for submitter contract with wrong return value")
}
if IsPrioritisedContractCall(params.FlareChainID, &prioritisedSubmitterContractAddressFlare, nil, postForkTime) {
if IsPrioritisedContractCall(params.FlareChainID, &prioritisedSubmitterContractAddress, nil, postForkTime) {
t.Errorf("Expected false for submitter contract with no return value")
}
}
18 changes: 9 additions & 9 deletions coreth/core/state_connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,15 @@ func GetDefaultAttestors(chainID *big.Int, blockTime *big.Int) []common.Address
case chainID.Cmp(params.FlareChainID) == 0:
if blockTime.Cmp(submitterContractActivationTimeFlare) > 0 {
return []common.Address{
common.HexToAddress("0x0988Cf4828F4e4eD0cE7c07467E70e19095Ee152"),
common.HexToAddress("0x6BC7DCa62010D418eB72CCdc58561e00C5868Ef1"),
common.HexToAddress("0xE34Bb361536610a9DCcEa5292262e36AfF65c06c"),
common.HexToAddress("0x8A3D627D86A81F5D21683F4963565C63DB5e1309"),
common.HexToAddress("0x2D3e7e4b19bDc920fd9C57BD3072A31F5a59FeC8"),
common.HexToAddress("0x6455dC38fdF739b6fE021b30C7D9672C1c6DEb5c"),
common.HexToAddress("0x49893c5Dfc035F4eE4E46faC014f6D4bC80F7f92"),
common.HexToAddress("0x08e8b2Af4874e920de27723576A13d66008Af523"),
common.HexToAddress("0x5D2f75392DdDa69a2818021dd6a64937904c8352"),
common.HexToAddress("0x4E07E1F3DB3Dc9BAd56Cc829747cc0148234329F"),
common.HexToAddress("0xB264Fad6Fdc65767998f93501945aB8F9108809d"),
common.HexToAddress("0x366BeC54195bfD45DBB34b79Ad2dEC4010598947"),
common.HexToAddress("0x2665B179d5fCE1118f06e23B5d6E7617c5Ff733A"),
common.HexToAddress("0x65cBaFaDD7C914179aabcE9C35f918a4E36AfFf9"),
common.HexToAddress("0x7eC6a7C7c4Ef003A75DC6c06352B48B37Ac2191B"),
common.HexToAddress("0xEa9bC2F98eFFC6A27E2C31733c1905961826f73B"),
common.HexToAddress("0xA4aA75a9B49c7f2B4be62b2999d7103E78D004C7"),
common.HexToAddress("0x4DF8436D7578C2d3bc73d33B6644913e131B70FC"),
}
} else {
return []common.Address{
Expand Down
2 changes: 1 addition & 1 deletion coreth/core/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) {

st.refundGas(rules.IsApricotPhase1)
if vmerr == nil && IsPrioritisedContractCall(chainID, msg.To(), ret, timestamp) && st.initialGas <= GetMaxFTSOGasLimit(timestamp) {
nominalGasUsed := uint64(params.TxGas) // 21000
nominalGasUsed := params.TxGas // 21000
nominalGasPrice := uint64(params.ApricotPhase4MinBaseFee) // 25_000_000_000; the max base fee is 1_000_000_000_000
nominalFee := new(big.Int).Mul(new(big.Int).SetUint64(nominalGasUsed), new(big.Int).SetUint64(nominalGasPrice))
actualGasUsed := st.gasUsed()
Expand Down

0 comments on commit f15d6d2

Please sign in to comment.