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

Extract NiPoPow #2060

Merged
merged 17 commits into from Nov 22, 2023
Merged

Extract NiPoPow #2060

merged 17 commits into from Nov 22, 2023

Conversation

ccellado
Copy link
Collaborator

@ccellado ccellado commented Nov 11, 2023

See #1965

Classes moved from src -> ergo-core/src

Some refactoring decoupling has to be made:

Extraction:
    - From mining/CandidateGenerator
      - deriveUnprovenHeader into mining/CandidateUtils
    - From reemission/ReimissionRules
      - Extract object into ReemissionRulesUtils
    - From ErgoSettings
      - Extract object into ErgoSettingsReader (stay in ergo-node)
    - From ErgoMempool
      - Extract object types into ErgoMempoolTypes
    - From nodeView/history/extra/ExtraIndexer
      - Extract trait ExtraIndex
    - From ErgoNodeViewSynchronizer
      - Extract ReseiveableMessages into ErgoNodeViewSynchronizerMessages
    - From BlockchainApiRoute
      - Extract SortDirection
    - From ErgoApp
      - Extract CriticalSystemException
    - From ErgoNodeViewHolder
      - Extract LocallyGeneratedModifier

@kushti
Copy link
Member

kushti commented Nov 13, 2023

@ccellado so if the main motivation for the core module I guess is to extract to there functionality needed for building alternative clients just. Then I guess node-specific parts should not be there, only consensus-related and p2p-related objects and functions ,so following parts should be moved away from it:

  • /history/extra , /history/storage and all the classes in /history but ErgoSyncInfo (which is used in p2p)
  • nodeview/mempool (aside of TransactionMembershipProof)
  • /http/api/requests, /scorex/api/http/ApiError
  • /scorex/core/network/peer, ConnectedPeer, ConnectionDirection

From org.ergoplatform.settings, makes sense to have ChainSettings, ValidationRules, Parameters, PeerFeatureDescriptors, removing NodeSettings etc

@ccellado
Copy link
Collaborator Author

- Extraction additional
  - From settings/Constants
    - mode modifierSerializers to ErgoNodeViewSynchronizer
  - From nodeView/history/ErgoHistory
    - types and constants to ErgoHistoryConstants
  - From http/api/ApiCodecs
    - Requests codecs into ApiRequestsCodecs
    - Extra codecs into ApiExtraCodecs

But there is a problem with ErgoState. Looks like it should not be in core

@ccellado
Copy link
Collaborator Author

Moved ErgoTransaction (which depends on ErgoStateContext which depends on ErgoSettings) and subsequent thing out of core, but ValidationRules depend on it

@ccellado ccellado requested a review from kushti November 15, 2023 14:25
@ccellado
Copy link
Collaborator Author

Do we need ValidationRules in core? Maybe not all of them

@ccellado
Copy link
Collaborator Author

  - From ApiCodecs
    - Move NodeView codecs
  - From scorex.core.network.message.Message
    - Move constants into MessageConstants
  - From scorex.core.network.message.BasicMessageRepo
    - SyncInfoMessageSpec
  1. PeerFeatureDescriptors depends on ModeFeatureSerializer which requires NodeConfigurationSettings
  2. PeerSpec (required by Handshake) depends on LocalAddressPeerFeature, RestApiUrlPeerFeature from scorex.core.network.peer

@ccellado
Copy link
Collaborator Author

Rebased onto 5016-refactor

  - From ErgoHistory
    - heightOf into ErgoHistoryUtils
  - From NodeConfigurationSettings
    - ClientCapabilities
    - UtxoSettings
    - NipopowSettings
  - From nodeView/state/StateType
    - to ergo-node Evidence into StateTypeErgo 

@ccellado ccellado marked this pull request as ready for review November 20, 2023 18:53
This was referenced Nov 21, 2023
kushti and others added 2 commits November 21, 2023 20:07
Minor refactorings
Moved some scorex.core classes into org.ergoplatform

To simplify creation of alternative clients for Ergo.
@kushti kushti changed the base branch from master to 5016-refactor November 22, 2023 09:55
@kushti kushti changed the base branch from 5016-refactor to v5.0.16 November 22, 2023 09:56
@kushti kushti merged commit 4aabb51 into ergoplatform:v5.0.16 Nov 22, 2023
3 of 4 checks passed
@kushti kushti mentioned this pull request Dec 5, 2023
kushti added a commit that referenced this pull request Dec 14, 2023
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.

None yet

2 participants