Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

README says changing Block or Transaction makes chain.dat stop loading, but adding a field or method still loads it

オープン
#21 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@tanujb03 がすでに取り組んでいます。

2026年10月10日 から。

  • #22 @tanujb03 による — オープン
  • #26 @YuuGR1337 による — オープン

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
25/100
issue の種類
ドキュメント
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
java
領域
documentation

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

documentation good first issue

What I did

  1. Fresh checkout of main (0e92205), JDK 17, Maven 3.9.
  2. mvn compile exec:java, then in the menu: 2 (mine a block, name asha), 1 (asha pays ravi 10), 8 (quit). This writes chain.dat.
  3. Followed the README sentence literally and changed Block: added private String note = "added"; under private String hash; in Block.java. Then mvn compile exec:java again.
  4. Repeated from a fresh chain.dat with other changes:
    • added a method public String memo() { return "changed"; } to Transaction
    • changed private static final long serialVersionUID = 2L; to 3L in Block
    • changed the same line to 3L in Transaction
    • changed private int nonce to private long nonce in Block

What I expected
The README, "Saving" section, says:

It is tied to the Block and Transaction classes. 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.

主要言語
Java
スター
0
フォーク
3
平均マージ
1日 22時間
マージ済み PR(30日)
10

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

techcsispit/mini-chain のほかの issue

techcsispit/mini-chain の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。