Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redefine Address as U128 + Identity and Hash as U256 #1616

Merged
merged 5 commits into from
Oct 18, 2024

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Aug 20, 2024

Description of Changes

Redefines Address as u128.

API and ABI breaking changes

Breaks the stored type of Address in system tables and in user tables.

Copy link
Member

@RReverser RReverser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C# LGTM modulo one final nit. Haven't looked at Rust much.

@Centril Centril changed the title WIP Redefine Address as U128 + Identity and Hash as U256 Aug 20, 2024
@Centril Centril force-pushed the centril/bytes-sink-write branch 3 times, most recently from 3057fa9 to fd209d1 Compare August 26, 2024 08:28
@bfops bfops added abi-break A PR that makes an ABI breaking change release-any To be landed in any release window release-0.12 and removed release-any To be landed in any release window labels Aug 26, 2024
Base automatically changed from centril/bytes-sink-write to master August 27, 2024 17:11
@RReverser
Copy link
Member

I think in the face of Tyler's proposal that changes identity/address representation altogether, this PR might become obsolete.

@Centril Centril force-pushed the centril/address-is-u128 branch 2 times, most recently from a6c144f to 035bfd6 Compare September 5, 2024 18:02
@Centril
Copy link
Contributor Author

Centril commented Sep 9, 2024

@RReverser My understanding is that the Identity type will still be a 32 byte value and in that case, this still makes it more efficient and more amenable to fast access through indices. The Address changes will become obsolete though. I'm holding off on more work on this PR until the picture becomes clearer.

Copy link
Collaborator

@bfops bfops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CLI changes LGTM

@kazimuth
Copy link
Contributor

This is now fully ready for merge together with https://github.com/clockworklabs/SpacetimeDBPrivate/pull/1060 @Centril

@Centril
Copy link
Contributor Author

Centril commented Oct 15, 2024

This is now fully ready for merge together with clockworklabs/SpacetimeDBPrivate#1060 @Centril

PR looks good, but did you give any thought to the formatting changes of identity? I personally think they are an improvement, but ymmv.

@kazimuth
Copy link
Contributor

PR looks good, but did you give any thought to the formatting changes of identity? I personally think they are an improvement, but ymmv.

Ah, see Ingvar's comment above.

Ah the Rust implementation probably needs to revert to original hex stringification as well. We do use identity/address strings in a few places (e.g. configs), so this would be a breaking change.

This is a breaking change anyway but it's a wipe-the-database breaking change rather than a rewrite-your-configs breaking change at the moment.

@Centril
Copy link
Contributor Author

Centril commented Oct 18, 2024

PR looks good, but did you give any thought to the formatting changes of identity? I personally think they are an improvement, but ymmv.

Ah, see Ingvar's comment above.

Ah the Rust implementation probably needs to revert to original hex stringification as well. We do use identity/address strings in a few places (e.g. configs), so this would be a breaking change.

This is a breaking change anyway but it's a wipe-the-database breaking change rather than a rewrite-your-configs breaking change at the moment.

In that case, I think this is good to merge, but I cannot approve my own PR... :)

Centril and others added 5 commits October 18, 2024 12:42
Co-authored-by: James Gilles <[email protected]>

Fix C#?

Fix codegen tests

Wipe old bench data before running bench tests

Fix csharp?

Revert U128/U256 formatting changes, they were printing numbers backwards

Fix failing test

Fix some passing tests, add a failing test

Bump serde_json version and add arbitrary_precision feature.
This allows passing u128 through serde_json::Value, which is done in the CLI crate.
@cloutiertyler cloutiertyler added this pull request to the merge queue Oct 18, 2024
Merged via the queue into master with commit 263511e Oct 18, 2024
7 of 8 checks passed
RReverser added a commit that referenced this pull request Oct 24, 2024
Looks like this was marked as resolved in review on #1616 by mistake. #1616 (comment)

Signed-off-by: Ingvar Stepanyan <[email protected]>
@RReverser RReverser mentioned this pull request Oct 24, 2024
2 tasks
lcodes pushed a commit that referenced this pull request Oct 25, 2024
@Centril Centril deleted the centril/address-is-u128 branch October 31, 2024 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
abi-break A PR that makes an ABI breaking change release-1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Redefine Identity (and Address) to use U256 (/U128)
5 participants