Skip to content

Conversation

@bltavares
Copy link
Member

@bltavares bltavares commented Feb 22, 2020

There are lots of things that will break.

Needs

Choose one: a 🙋 feature

Checklist

  • tests pass
  • tests and/or benchmarks are included
  • documentation is changed or added

Context

Updating random-access-storage to the latest version requires a lot of changes, as it changes the api from usize's to u64's

Semver Changes

minor (breaking, but below 1.0.0)

bltavares added a commit to bltavares/flat-tree that referenced this pull request Feb 23, 2020
On [random-access-storage](https://github.com/datrs/random-access-storage) issue
datrs/random-access-storage#6 has changed all
types from `usize` into `u64` to be able to handle more than 4gbs on
32bits systems.

> usize is 32 bits on a 32 bit system, so the storage would be limited
to 4GB on such a system.

When changing `random-access-storage` on `hypercore` (tracking:
datrs/hypercore#100) one of the things I've
noticed is that it wold be easier to also make `flat-tree` use `u64` to
integrate with `random-access-storage`. Very likely, this also means
that we would need to bump to use more than 32Gb storages on
`flat-tree`.

I've simply changed all declarations of usize into u64. All tests are
passing.
bltavares added a commit to bltavares/merkle-tree-stream that referenced this pull request Feb 24, 2020
On [random-access-storage](https://github.com/datrs/random-access-storage)
issue
datrs/random-access-storage#6 has changed all
types from `usize` into `u64` to be able to handle more than 4gbs on
32bits systems.

> usize is 32 bits on a 32 bit system, so the storage would be limited
to 4GB on such a system.

When changing `random-access-storage` on `hypercore` (tracking:
datrs/hypercore#100) one of the things I've
noticed is that it wold be easier to also make `merkle-tree-stream` use
`u64` to integrate with `random-access-storage`. Very likely, this also
means that we would need to bump to use more than 32Gb storages on
`merkle-tree-stream`.

I've simply changed all declarations of usize into u64. All tests are
passing.

Needs:
---

- [ ] datrs/flat-tree#44
@bltavares
Copy link
Member Author

@khernyo @substack Hi there, sorry to bother. I'm in the middle of the upgrade to random-access-storage using the new API using u64 instead of usizes, and I'm not sure if I'm doing it right.

I'm reflecting the changes on the other libraries (merkle-tree-stream, tree-index, flat-tree) as I go as it requires less castings on hypercore, but I'm not sure if I'm doing it right.

Should I avoid changing the other libs and just keep the casts on hypercore instead? I'll wait a bit on changing the other libs until I have some feedback here.

bltavares added a commit to bltavares/tree-index that referenced this pull request Feb 24, 2020
On [random-access-storage](https://github.com/datrs/random-access-storage)
issue
datrs/random-access-storage#6 has changed all
types from `usize` into `u64` to be able to handle more than 4gbs on
32bits systems.

> usize is 32 bits on a 32 bit system, so the storage would be limited
to 4GB on such a system.

When changing `random-access-storage` on `hypercore` (tracking:
datrs/hypercore#100) one of the things I've
noticed is that it wold be easier to also make `tree-index` use
`u64` to integrate with `random-access-storage`. Very likely, this also
means that we would need to bump to use more than 32Gb storages on
`tree-index`.

I've simply changed all declarations of usize into u64. All tests are
passing.

It also fixes Travis CI and update libraries to latest version.

Needs:
---

- [ ] datrs/flat-tree#44
This commit compiles `hypercore` using the new u64 crates:

- random-access-storage
- random-access-disk
- random-access-memmory
- merkle-tree-stream
- flat-tree
- index-tree
@bltavares
Copy link
Member Author

I've got it to compile with the extra crates (except for bitfield) changed from usize to u64 as well.

I'm not sure how correct things are, and if the other crates also need to change, but it compiles now, and the tests passes.

If someone could review it, and the other PRs on the other crates (specially if they are necessary), I would love that.

@bltavares
Copy link
Member Author

Given that the API takes slices, I think it will also be limited by 32bits systems as well, from what I understood.

Maybe it would be nice to ship the new version and have a setup test on a 32bit platform to find errors.

What are relevant 32-bits platforms to keep testing? (Given that apple 32-bits has been lowered to second-tier)

yoshuawuyts pushed a commit to datrs/merkle-tree-stream that referenced this pull request Mar 2, 2020
* Change from usize to u64

On [random-access-storage](https://github.com/datrs/random-access-storage)
issue
datrs/random-access-storage#6 has changed all
types from `usize` into `u64` to be able to handle more than 4gbs on
32bits systems.

> usize is 32 bits on a 32 bit system, so the storage would be limited
to 4GB on such a system.

When changing `random-access-storage` on `hypercore` (tracking:
datrs/hypercore#100) one of the things I've
noticed is that it wold be easier to also make `merkle-tree-stream` use
`u64` to integrate with `random-access-storage`. Very likely, this also
means that we would need to bump to use more than 32Gb storages on
`merkle-tree-stream`.

I've simply changed all declarations of usize into u64. All tests are
passing.

Needs:
---

- [ ] datrs/flat-tree#44

* Fix travis
@bltavares bltavares marked this pull request as ready for review March 3, 2020 01:20
@bltavares bltavares merged commit f7af79a into datrs:master Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants