Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kaiax/gov: Replace remaining with gov #177

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from

Conversation

ian0371
Copy link
Collaborator

@ian0371 ian0371 commented Dec 12, 2024

Proposed changes

This PR is a sequel of #162.

Types of changes

  • Bugfix
  • New feature or enhancement
  • Others

Checklist

  • I have read the CONTRIBUTING GUIDELINES doc
  • I have read the CLA and signed by comment I have read the CLA Document and I hereby sign the CLA in first time contribute
  • Lint and unit tests pass locally with my changes ($ make test)
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

Further comments

MixedEngine method replaced by GovModule

It excludes governance directory, as they will be removed.

  • EffectiveParams
  • CurrentParams
  • AddVote
  • ValidateVote
  • ReadGovernance
  • WriteGovernance
  • GetEncodedVote
  • VerifyGovernance
  • GetVoteMapCopy
  • GetGovernanceTalliesCopy
  • CurrentSetCopy
  • PendingChanges
  • IdxCache
  • IdxCacheFromDb
  • NodeAddress
  • TotalVotingPower
  • MyVotingPower
  • SetNodeAddress
  • GetGovernanceItemsFromChainConfig
  • SetTxPool
  • GetTxPool
  • BlockChain
  • DB
MixedEngine methods that will be completely removed by ValSet module

These will be removed after introducing ValSet module.

  • UpdateParams
  • CanWriteGovernanceState
  • WriteGovernanceState
  • ClearVotes
  • WriteGovernanceForNextEpoch
  • UpdateCurrentSet
  • HandleGovernanceVote
  • Votes
  • SetTotalVotingPower
  • SetMyVotingPower
  • SetBlockchain
ChainConfig replaced by GovModule
  • next basefee in worker
  • next basefee in txpool
  • node/cn/backend.go:New: UnitPrice. Removed because it's unused.
  • blockchain/types/derivesha/mux.go:getType: DeriveShaImpl.
ChainConfig left as-is

There are cases when the genesis chain config can be used. Either it's immutable, or not essential to use the latest value.

  • blockchain/genesis.go:SetGenesisGovernance: initial 13 parameters. Not called by ken init.
  • UnitPrice
    • accounts/abi/bind/backends.go:SuggestGasPrice: UnitPrice. The value does not matter. Also, importing GovModule results in import cycle.
    • datasync/dbsyncer/dbsync.go:syncBlockHeader: UnitPrice. The value does not matter.
    • datasync/dbsyncer/dbsync_context.go:syncBlockHeaderContext: UnitPrice. The value does not matter.
    • datasync/dbsyncer/dbsync_multi.go:parallelSyncBlockHeader: UnitPrice. The value does not matter.
  • Governance
    • blockchain/genesis.go:SetupGenesisBlock: StakingUpdateInterval, ProposerUpdateInterval. The value is immutable.
    • cmd/utils/nodecmd/chaincmd.go:initGenesis: StakingUpdateInterval, ProposerUpdateInterval. The value is immutable.
    • blockchain/genesis.go:ToBlock: LowerBoundBaseFee. Genesis config must be used.
    • kaiax/staking/impl/init.go:Init: StakingUpdateInterval, UseGiniCoeff, MinimumStake. The value is immutable.
    • node/cn/handler.go:{handleStakingInfoRequestMsg,handleStakingInfoMsg}: UseGiniCoeff, MinimumStake. The value is immutable.
    • blockchain/state_transition.go:TransitionDb: DeferredTxFee. The value is immutable. Also, adding GovModule to the object is difficult.
    • cmd/utils/nodecmd/chaincmd.go:ValidateGenesisConfig: ProposerUpdateInterval, StakingUpdateInterval, GovernanceMode, GoverningNode. Genesis config must be used.
  • Istanbul
    • blockchain/blockchain.go:isCommitTrieRequired: ProposerPolicy. The value is immutable.
    • blockchain/blockchain.go:setHeadBeyondRoot: Epoch. The value is immutable.
    • consensus/istanbul/backend/engine.go:Finalize: ProposerPolicy. The value is immutable.
    • node/cn/handler.go:{handleStakingInfoRequestMsg,handleStakingInfoMsg}: ProposerPolicy. The value is immutable.
ChainConfig replaced by GovModule
  • next basefee in worker
  • next basefee in txpool
  • node/cn/backend.go:New: UnitPrice. Removed because it's unused.
  • blockchain/types/derivesha/mux.go:getType: DeriveShaImpl.
ChainConfig that will be completely removed by ValSet module These will be removed after introducing ValSet module.
  • consensus/istanbul/backend/backend.go:{ParentValidators,getValidators}: ProposerPolicy, SubGroupSize.
  • consensus/istanbul/validator/weighted.go:RefreshValSet: UseGiniCoeff.

@ian0371 ian0371 self-assigned this Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants