Divide large code files into smaller ones #1389

Open
opened 2025-12-28 17:16:16 +00:00 by sami · 2 comments
Owner

Originally created by @lock9 on GitHub (Oct 14, 2024).

Some files in the project, like blockchain.go, are too large for most AI models. With over 3,000 lines, it can't be directly 'pasted' into ChatGPT. I had to debug neo-go to get some things working, and locating what I needed was challenging.

Note: I don't intend to change any structure, just to 'split source code files into smaller chunks.'

Describe the solution you'd like

Split blockchain.go into smaller files (and possibly other large files as well).

Describe alternatives you've considered

Additional context

This is primarily a structural improvement to the code. It shouldn't affect the expected behavior. My tool already splits the file into smaller parts before sending it to ChatGPT, but this consumes far more API credits than necessary, and the responses are often inaccurate or incomplete. Having a 'human' divide the code will help the AI avoid mistakes.

  • Enhancement
  • Low priority
Originally created by @lock9 on GitHub (Oct 14, 2024). ## Is your feature request related to a problem? Please describe. Some files in the project, like `blockchain.go`, are too large for most AI models. With over 3,000 lines, it can't be directly 'pasted' into ChatGPT. I had to debug neo-go to get some things working, and locating what I needed was challenging. Note: I don't intend to change any structure, just to 'split source code files into smaller chunks.' ## Describe the solution you'd like Split `blockchain.go` into smaller files (and possibly other large files as well). ## Describe alternatives you've considered ## Additional context This is primarily a structural improvement to the code. It shouldn't affect the expected behavior. My tool already splits the file into smaller parts before sending it to ChatGPT, but this consumes far more API credits than necessary, and the responses are often inaccurate or incomplete. Having a 'human' divide the code will help the AI avoid mistakes. - Enhancement - Low priority
Author
Owner

@roman-khimov commented on GitHub (Oct 14, 2024):

Likely these tools will be upgraded before we do this and it's hard for me to accept the idea of changing something in the code for tools that are supposed to be eating petabytes of data for breakfast. But I admit blockchain.go and RPC's server.go are not easy to navigate through for humans as well, so some refactoring can still be beneficial.

@roman-khimov commented on GitHub (Oct 14, 2024): Likely these tools will be upgraded before we do this and it's hard for me to accept the idea of changing something in the code for tools that are supposed to be eating petabytes of data for breakfast. But I admit `blockchain.go` and RPC's `server.go` are not easy to navigate through for humans as well, so some refactoring can still be beneficial.
Author
Owner

@lock9 commented on GitHub (Oct 14, 2024):

These were the files that I 'struggled' the most:

  • dao.go
  • rpcsrv/server.go
  • blockchain.go

Note: Having several files with the same name also made me get lost a few times (now that I know which one to use)
Screenshot 2024-10-14 at 14 08 03

Screenshot 2024-10-14 at 14 08 50

@lock9 commented on GitHub (Oct 14, 2024): These were the files that I 'struggled' the most: - `dao.go` - `rpcsrv/server.go` - `blockchain.go` Note: Having several files with the same name also made me get lost a few times (now that I know which one to use) ![Screenshot 2024-10-14 at 14 08 03](https://github.com/user-attachments/assets/5db6d333-ede1-4e7e-a65f-4ef0d61acf7c) ![Screenshot 2024-10-14 at 14 08 50](https://github.com/user-attachments/assets/0531ccf4-7a24-4ff6-8d5b-071555f03a33)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nspcc-dev/neo-go#1389
No description provided.