Commit Graph

9 Commits

Author SHA1 Message Date
Alessio Treglia 2e04f2778f
snapshots: document use of ioutil.TempDir() (#8508)
Document with inline comments the changes introduced
in https://github.com/cosmos/cosmos-sdk/pull/8475.

Run make format.
2021-02-04 09:54:01 +00:00
Alessio Treglia 8128357956
snapshots: fix flaky tests (#8475)
The use testing.T.TempDir() seems to cause test failures
in CI environvements in those cases where temporary
directories' subdirs are created with permissions that
are different from the defaults used by testing.T.TempDir().
The snapshots package's tests seem to be heavily affected,
thus this replaces testing.T.TempDir() occurrences with
ioutil.TempDir() calls.

Related upstream issue:
- https://github.com/golang/go/issues/40853

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-02-01 10:48:32 +00:00
Riccardo Montagnin e2f510afcc
Compatibility with the ARM architecture (#8396)
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Jonathan Gimeno <jgimeno@gmail.com>
2021-01-27 11:07:45 +00:00
Aaron Craelius 2521964d50
Update gogo proto deps with v1.3.2 security fixes (#8350)
* Update gogo proto deps with v1.3.2 security fixes

* Regenerate proto files
2021-01-15 19:45:34 +00:00
Robert Zaremba 6de685805d
Snapshot sync: use hasher for chunk hashes (#7215) (#7259)
* snapshot sync: use blake3 for chunk hashes (7215)

Blake3 improves on security and speed compared to sha256.
https://blake3.io/

In this PR:
+ use optimized blake3 hashes (with dedicated SIMD code)
  instead of sha256
+ reuse resources on hashing chunks.
+ cleaned few error return statements.

* linter issues fixes

* revert blake2 hashing to sha256

* revert go.mod

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-12-10 19:02:17 +00:00
Alessio Treglia 056f416d2b
use testutil in test cases (#8130)
Also replace defer calls with
testing.T.Cleanup()
2020-12-10 12:56:55 +00:00
Erik Grinaker 5e16c215ba
test: fix data race in snapshots.ChunkReader test (#7299)
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-09-14 14:00:08 +01:00
Alessio Treglia 46a8e94740
run make format && go mod tidy (#7298) 2020-09-14 12:42:09 +01:00
Erik Grinaker 4faeefebd2
Add state sync support (#7166)
* Add state sync support

* fix incorrect test tempdir

* proto: move and update Protobuf schemas

* proto: lint fixes

* comment tweaks

* don't use type aliasing

* don't call .Error() when logging errors

* use create terminology instead of take for snapshots

* reuse chunk hasher

* simplify key encoding code

* track chunk index in Manager

* add restoreDone message for Manager

* add a ready channel to Snapshotter.Restore()

* add comment on streaming IO API

* use sdkerrors for error handling

* fix incorrect error

* tweak changelog

* syntax fix

* update test code after merge
2020-09-08 09:05:44 +00:00