Skip to content

Commit

Permalink
internal/params: un-schedule mainnet hard forks (#4420)
Browse files Browse the repository at this point in the history
* internal/params: un-schedule mainnet hard forks

and add logs to help debug the recent consensus loss

* core/state: update logs
  • Loading branch information
MaxMustermann2 authored May 9, 2023
1 parent 01691fd commit 5195577
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
23 changes: 18 additions & 5 deletions core/state/state_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,12 @@ func (s *Object) Code(db Database, isValidatorCode bool) []byte {
if s.validatorWrapper || isValidatorCode {
code, err := db.ValidatorCode(s.addrHash, common.BytesToHash(s.CodeHash()))
if err != nil {
s.setError(fmt.Errorf("can't load validator code hash %x: %v", s.CodeHash(), err))
s.setError(
fmt.Errorf(
"can't load validator code for address %s hash %x: %v",
s.address.Hex(), s.CodeHash(), err,
),
)
}
if code != nil {
s.code = code
Expand All @@ -518,10 +523,18 @@ func (s *Object) Code(db Database, isValidatorCode bool) []byte {
}
code, err := db.ContractCode(s.addrHash, common.BytesToHash(s.CodeHash()))
if err != nil {
s.setError(fmt.Errorf("can't load code hash %x: %v", s.CodeHash(), err))
}
s.code = code
return code
s.setError(
fmt.Errorf(
"can't load code for address %s hash %x: %v",
s.address.Hex(), s.CodeHash(), err,
),
)
}
if code != nil {
s.code = code
return code
}
return nil
}

// CodeSize returns the size of the contract/validator code associated with this object,
Expand Down
4 changes: 2 additions & 2 deletions internal/params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ var (
AllowlistEpoch: EpochTBD,
LeaderRotationExternalNonBeaconLeaders: EpochTBD,
LeaderRotationExternalBeaconLeaders: EpochTBD,
FeeCollectEpoch: big.NewInt(1451), // 2023-05-17 04:02:00+00:00
ValidatorCodeFixEpoch: big.NewInt(1451),
FeeCollectEpoch: EpochTBD,
ValidatorCodeFixEpoch: EpochTBD,
}

// TestnetChainConfig contains the chain parameters to run a node on the harmony test network.
Expand Down

0 comments on commit 5195577

Please sign in to comment.