[committee] Enable Staking on localnet at epoch 3

pull/1850/head
Edgar Aroutiounian 5 years ago
parent 18b915ed82
commit 66f6e0a26c
  1. 4
      core/state_transition.go
  2. 2
      internal/params/config.go
  3. 9
      shard/committee/assignment.go

@ -285,8 +285,10 @@ func (st *StateTransition) StakingTransitionDb() (usedGas uint64, err error) {
// Pay intrinsic gas
// TODO: propose staking-specific formula for staking transaction
gas, err := IntrinsicGas(st.data, false, homestead)
// TODO Remove this logging
utils.Logger().Info().Uint64("Using", gas).Msg("Gas cost of staking transaction being processed")
if err != nil {
utils.Logger().Error().Uint64("needed", gas).Msg("Not enough gas in staking transaction")
return 0, err
}
if err = st.useGas(gas); err != nil {

@ -36,7 +36,7 @@ var (
ChainID: TestnetChainID,
CrossTxEpoch: big.NewInt(0),
CrossLinkEpoch: big.NewInt(0),
StakingEpoch: EpochTBD,
StakingEpoch: big.NewInt(3),
EIP155Epoch: big.NewInt(0),
S3Epoch: big.NewInt(0),
}

@ -119,7 +119,8 @@ func eposStakedCommittee(
// TODO Nervous about this because overtime the list will become quite large
candidates := stakerReader.ValidatorCandidates()
essentials := map[common.Address]effective.SlotOrder{}
utils.Logger().Info().Int("candidates-count", len(candidates)).Msg("Preparing EPoS Staked Committee")
utils.Logger().Info().Int("staked-candidates", len(candidates)).Msg("preparing epos staked committee")
// TODO benchmark difference if went with data structure that sorts on insert
for i := range candidates {
@ -172,7 +173,11 @@ func eposStakedCommittee(
&slot.Dec,
})
}
if c := len(candidates); c != 0 {
utils.Logger().Info().Int("staked-candidates", c).
RawJSON("staked-super-committee", []byte(superComm.JSON())).
Msg("EPoS based super-committe")
}
return superComm, nil
}

Loading…
Cancel
Save