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

Commit

Permalink
Merge pull request #1471 from hyperledger/vent
Browse files Browse the repository at this point in the history
Fix LoadDump not setting tx index
  • Loading branch information
Silas Davis committed Mar 25, 2021
2 parents fa5ab51 + f325786 commit b193c90
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 13 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# [Hyperledger Burrow](https://github.com/hyperledger/burrow) Changelog
## [0.31.3] - 2020-03-25
### Fixed
- [Dump] Make load from dump set tx index so BlockAccumulator continuity conditions are met
- [Dump] Improve error messages


## [0.31.2] - 2020-03-24
### Fixed
- [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)
Expand Down Expand Up @@ -726,6 +732,7 @@ This release marks the start of Eris-DB as the full permissioned blockchain node
- [Blockchain] Fix getBlocks to respect block height cap.


[0.31.3]: https://github.com/hyperledger/burrow/compare/v0.31.2...v0.31.3
[0.31.2]: https://github.com/hyperledger/burrow/compare/v0.31.1...v0.31.2
[0.31.1]: https://github.com/hyperledger/burrow/compare/v0.31.0...v0.31.1
[0.31.0]: https://github.com/hyperledger/burrow/compare/v0.30.5...v0.31.0
Expand Down
7 changes: 2 additions & 5 deletions NOTES.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
### Fixed
- [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)
- [Genesis] Fix hash instability introduced by accidentally removing omitempty from AppHash in genesis

### Added
- [Vent] Implement throttling on Ethereum Vent consumer via --max-request-rate=<requests / time base> flag to 'vent start'
- [Dump] Make load from dump set tx index so BlockAccumulator continuity conditions are met
- [Dump] Improve error messages

5 changes: 4 additions & 1 deletion bcm/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,10 @@ func (bc *Blockchain) save() error {
if err != nil {
return err
}
bc.db.SetSync(stateKey, encodedState)
err = bc.db.SetSync(stateKey, encodedState)
if err != nil {
return err
}
}
return nil
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/burrow/commands/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ func Restore(output Output) func(cmd *cli.Cmd) {

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

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

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

kern.ShutdownAndExit()
Expand Down
8 changes: 4 additions & 4 deletions core/kernel.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,21 +191,21 @@ func (kern *Kernel) LoadDump(genesisDoc *genesis.GenesisDoc, restoreFile string,

reader, err := dump.NewFileReader(restoreFile)
if err != nil {
return err
return fmt.Errorf("could not create dump file reader: %w", err)
}

err = dump.Load(reader, kern.State)
if err != nil {
return err
return fmt.Errorf("could not load dump state: %w", err)
}

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

kern.Logger.InfoMsg("State restore successful",
Expand Down
5 changes: 5 additions & 0 deletions project/history.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ func FullVersion() string {
// release tagging script: ./scripts/tag_release.sh
var History relic.ImmutableHistory = relic.NewHistory("Hyperledger Burrow", "https://github.com/hyperledger/burrow").
MustDeclareReleases(
"0.31.3 - 2020-03-25",
`### Fixed
- [Dump] Make load from dump set tx index so BlockAccumulator continuity conditions are met
- [Dump] Improve error messages
`,
"0.31.2 - 2020-03-24",
`### Fixed
- [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)
Expand Down

0 comments on commit b193c90

Please sign in to comment.