Skip to content
This repository was archived by the owner on May 13, 2022. It is now read-only.

Commit b193c90

Browse files
author
Silas Davis
authored
Merge pull request #1471 from hyperledger/vent
Fix LoadDump not setting tx index
2 parents fa5ab51 + f325786 commit b193c90

File tree

6 files changed

+25
-13
lines changed

6 files changed

+25
-13
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
# [Hyperledger Burrow](https://github.com/hyperledger/burrow) Changelog
2+
## [0.31.3] - 2020-03-25
3+
### Fixed
4+
- [Dump] Make load from dump set tx index so BlockAccumulator continuity conditions are met
5+
- [Dump] Improve error messages
6+
7+
28
## [0.31.2] - 2020-03-24
39
### Fixed
410
- [Dump] Stop TxStack EventStream consumer from rejecting events from dump/restored chain because they lack tx Envelopes (as they are intended to to keep dump format minimal)
@@ -726,6 +732,7 @@ This release marks the start of Eris-DB as the full permissioned blockchain node
726732
- [Blockchain] Fix getBlocks to respect block height cap.
727733

728734

735+
[0.31.3]: https://github.com/hyperledger/burrow/compare/v0.31.2...v0.31.3
729736
[0.31.2]: https://github.com/hyperledger/burrow/compare/v0.31.1...v0.31.2
730737
[0.31.1]: https://github.com/hyperledger/burrow/compare/v0.31.0...v0.31.1
731738
[0.31.0]: https://github.com/hyperledger/burrow/compare/v0.30.5...v0.31.0

NOTES.md

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
### Fixed
2-
- [Dump] Stop TxStack EventStream consumer from rejecting events from dump/restored chain because they lack tx Envelopes (as they are intended to to keep dump format minimal)
3-
- [Genesis] Fix hash instability introduced by accidentally removing omitempty from AppHash in genesis
4-
5-
### Added
6-
- [Vent] Implement throttling on Ethereum Vent consumer via --max-request-rate=<requests / time base> flag to 'vent start'
2+
- [Dump] Make load from dump set tx index so BlockAccumulator continuity conditions are met
3+
- [Dump] Improve error messages
74

bcm/blockchain.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,10 @@ func (bc *Blockchain) save() error {
156156
if err != nil {
157157
return err
158158
}
159-
bc.db.SetSync(stateKey, encodedState)
159+
err = bc.db.SetSync(stateKey, encodedState)
160+
if err != nil {
161+
return err
162+
}
160163
}
161164
return nil
162165
}

cmd/burrow/commands/restore.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ func Restore(output Output) func(cmd *cli.Cmd) {
2727

2828
kern, err := core.NewKernel(conf.BurrowDir)
2929
if err != nil {
30-
output.Fatalf("could not create Burrow kernel: %v", err)
30+
output.Fatalf("could not create Burrow kernel: %w", err)
3131
}
3232

3333
if err = kern.LoadLoggerFromConfig(conf.Logging); err != nil {
34-
output.Fatalf("could not create Burrow kernel: %v", err)
34+
output.Fatalf("could not load logger: %w", err)
3535
}
3636

3737
if err = kern.LoadDump(conf.GenesisDoc, *filename, *silentOpt); err != nil {
38-
output.Fatalf("could not create Burrow kernel: %v", err)
38+
output.Fatalf("could not load dump: %v", err)
3939
}
4040

4141
kern.ShutdownAndExit()

core/kernel.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -191,21 +191,21 @@ func (kern *Kernel) LoadDump(genesisDoc *genesis.GenesisDoc, restoreFile string,
191191

192192
reader, err := dump.NewFileReader(restoreFile)
193193
if err != nil {
194-
return err
194+
return fmt.Errorf("could not create dump file reader: %w", err)
195195
}
196196

197197
err = dump.Load(reader, kern.State)
198198
if err != nil {
199-
return err
199+
return fmt.Errorf("could not load dump state: %w", err)
200200
}
201201

202202
if !bytes.Equal(kern.State.Hash(), kern.Blockchain.GenesisDoc().AppHash) {
203-
return fmt.Errorf("restore produced a different apphash expect 0x%x got 0x%x",
203+
return fmt.Errorf("restore produced a different apphash, expected %X by actual was %X",
204204
kern.Blockchain.GenesisDoc().AppHash, kern.State.Hash())
205205
}
206206
err = kern.Blockchain.CommitWithAppHash(kern.State.Hash())
207207
if err != nil {
208-
return fmt.Errorf("unable to commit %v", err)
208+
return fmt.Errorf("unable to commit %w", err)
209209
}
210210

211211
kern.Logger.InfoMsg("State restore successful",

project/history.go

+5
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ func FullVersion() string {
4848
// release tagging script: ./scripts/tag_release.sh
4949
var History relic.ImmutableHistory = relic.NewHistory("Hyperledger Burrow", "https://github.com/hyperledger/burrow").
5050
MustDeclareReleases(
51+
"0.31.3 - 2020-03-25",
52+
`### Fixed
53+
- [Dump] Make load from dump set tx index so BlockAccumulator continuity conditions are met
54+
- [Dump] Improve error messages
55+
`,
5156
"0.31.2 - 2020-03-24",
5257
`### Fixed
5358
- [Dump] Stop TxStack EventStream consumer from rejecting events from dump/restored chain because they lack tx Envelopes (as they are intended to to keep dump format minimal)

0 commit comments

Comments
 (0)