kaiachain / kaia

GNU Lesser General Public License v3.0
21 stars 26 forks source link

kaiax: Add module framework and dummy noop module #57

Closed blukat29 closed 2 months ago

blukat29 commented 3 months ago

Proposed changes

Types of changes

Please put an x in the boxes related to your change.

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

Related issues

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

hyunsooda commented 3 months ago

Seems like a good starting point. Here is a suggestion for the prototype structure. Maybe you already thought about this.

VerifyHeader() in the ConsensusModule is complex and strongly coupled with the governance handler, particularly regarding snapshots. Introducing a separate GovernanceModule could provide an opportunity to refactor and reduce this complexity by decoupling these responsibilities.

blukat29 commented 3 months ago

@hyunsooda Exactly. That's what I am going to do next.

I imagine these modules can exist. The modules can refer each other via Init()

blukat29 commented 2 months ago

@hyunsooda Exactly! the module functions are indeed event handlers at various stages in block processing. A Kaia core functionality can be formulated as 'a set of customizations to the Ethereum block processing pipeline'. I just did not name them like OnBlockInsert. Tell me if you have any naming suggestions.