README says changing Block or Transaction makes chain.dat stop loading, but adding a field or method still loads it
Maintainer thường phản hồi trong vòng 2 ngày
@tanujb03 đang làm issue này rồi.
Từ ngày 10/10/2026.
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- java
- Lĩnh vực
- documentation
Hướng nghiên cứu
The sentence to change is in the README's "Saving" section, which says changing Block or Transaction stops chain.dat from loading. Compare it with the version-comment in Block.java and Transaction.java and with the fallback in Storage.load, which together show that only incompatible serialization changes stop loading. Done means the README says added fields or methods still load and gives one example that does stop loading. A linked pull request (#22) already exists, so check it before starting.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What I did
- Fresh checkout of
main(0e92205), JDK 17, Maven 3.9. mvn compile exec:java, then in the menu:2(mine a block, nameasha),1(asha pays ravi 10),8(quit). This writeschain.dat.- Followed the README sentence literally and changed
Block: addedprivate String note = "added";underprivate String hash;inBlock.java. Thenmvn compile exec:javaagain. - Repeated from a fresh
chain.datwith other changes:- added a method
public String memo() { return "changed"; }toTransaction - changed
private static final long serialVersionUID = 2L;to3LinBlock - changed the same line to
3LinTransaction - changed
private int noncetoprivate long nonceinBlock
- added a method
What I expected
The README, "Saving" section, says:
It is tied to the
BlockandTransactionclasses. Change either one and the file stops loading, and the program starts a new chain instead.
So after any change to Block or Transaction, the program should start a new chain.
What happened instead
| Change | What the program printed |
|---|---|
add a field to Block |
Loaded chain.dat. (old chain, queued payment and balances intact) |
add a method to Transaction |
Loaded chain.dat. |
serialVersionUID 2L to 3L in Block |
Couldn't read chain.dat (InvalidClassException), so a new chain was started. |
serialVersionUID 2L to 3L in Transaction |
Loaded chain.dat. |
nonce int to long in Block |
Couldn't read chain.dat (InvalidClassException), so a new chain was started. |
So the file stops loading only for changes Java serialization treats as incompatible. This looks intended: Block.java and Transaction.java carry the comment // bump version only for incompatible changes, adding a field is safe, and Storage.load falls back to a new chain when it can't read the file. The README sentence is the part that is too broad.
I'd like to fix the README wording only (no code change), so that it says adding a field or method still loads, and gives an example of a change that does make the file stop loading.
Environment
main @ 0e92205, JDK 17.0.12, Maven 3.9.16, Windows 11.
- Ngôn ngữ chính
- Java
- Star
- 0
- Fork
- 3
- Merge trung bình
- 1 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 10
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của techcsispit/mini-chain
-
Enhancement: Deterministic transaction hashing across all record fieldsCó thể đã có người làm @sohanjadyal đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
techcsispit/mini-chain#29 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Enhancement: Migrate to native Ed25519 signatures and public-key address derivationCó thể đã có người làm @sohanjadyal đã nhận hôm nay. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
techcsispit/mini-chain#31 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Blockchain: a payment that was already mined can be submitted again, and it is accepted and mined a second timeCó thể đã có người làm @tanujb03 đã nhận 7 ngày trước. Đang mởbug good first issue
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
techcsispit/mini-chain#16 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
A signed payment can be altered (payee and amount) and still pass signature verificationCó thể đã có người làm @tanujb03 đã nhận 7 ngày trước. Đang mởadvanced bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
techcsispit/mini-chain#15 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của techcsispit/mini-chain
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
apache/rocketmq-dashboard#6896 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
OpenIntegrationEngine/engine#496 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
SasanLabs/VulnerableApp#836 ·
Maintainer thường phản hồi trong vòng 1 ngày