Open JayWhite2357 opened 1 month ago
/bounty $1000
/attempt #229
with your implementation plan. Note: we will only assign an issue if you include an implementation plan with a time estimate. Additionally, to be assigned an issue, you must have previously contributed to the project. You can still work on an issue and submit a PR without being assigned./claim #229
in the PR body to claim the bountyThank you for contributing to spaceandtimelabs/sxt-proof-of-sql!
Add a bounty • Share on socials
Attempt | Started (GMT+0) | Solution |
---|---|---|
🔴 @Ashu999 | Oct 7, 2024, 10:45:20 AM | WIP |
/attempt #229
Algora profile | Completed bounties | Tech | Active attempts | Options |
---|---|---|---|---|
@Ashu999 | 1 bounty from 1 project | JavaScript, Python, TypeScript |
Cancel attempt |
Hello @JayWhite2357
I’d be happy to take on this issue. I think it could be broken down into multiple PRs for smaller, easier-to-test patches. Let me know if that works for you, or if you’d prefer to handle it all in one go.
I’ve just joined the Discord and would be happy to discuss it further.
@tareknaser I agree that this makes sense to be broken into smaller PRs. We much prefer smaller PRs over large PRs.
It looks like there are multiple people working on this issue. It may be wise for you to coordinate via Discord. In the case where there are multiple PRs that get merged from different contributors completing the issue, I will split the bounty according to my best judgement. (Unless the contributors have already agreed on a split.) Alternatively, someone can break this into smaller issues, and I can assign smaller bounties to each.
It’s a bit tricky to break the issue into clear pieces right now. I think it’ll become clearer once we begin the actual implementation. I can start with a small PR to implement FixedSizeBinary
to set the stage for follow-up PRs. During the PR review, we can probably get a better sense of how to proceed.
Would that be okay with you, @Ashu999 ?
sure, go ahead @tareknaser
Testing out two other bounty program options here: /boss $1000 verify
Total Bounty: $1000
Hi @JayWhite2357 - Is this issue still available to pick up?
Background and Motivation
Many data are binary blobs. In particular, the EVM address and hash types are 20 bytes and 32 bytes respectively. We should support these natively within Proof of SQL. See https://docs.rs/arrow/latest/arrow/datatypes/enum.DataType.html#variant.FixedSizeBinary.
Changes Requested
Add full support for a
FixedSizeBinary
type. In order to do this there are several considerations.Scalar
types support naturally embedding 31 bytes but not 32 bytes, there should be a divergence in how <=31 bytes are handled and 32 bytes are handled.Scalar
type. This means simply relying on the conversion from[u64; 4]
to theScalar
.Scalar
. This is identical to howString
s are handled. See https://github.com/spaceandtimelabs/sxt-proof-of-sql/blob/48b2f0bc8b92dbc3ef9deecfdfc04dfbc2b4460c/crates/proof-of-sql/src/base/scalar/mont_scalar_from.rs#L16.ColumnType
should probably have a new variantFixedSizeBinary(i32)
added. It is not as clear what the variant forColumn
andOwnedColumn
should be.FixedSizeBinary(i32, &'a [u8])
andFixedSizeBinary(i32, Vec<u8>)
respectively, but that may not make sense. The reason for this suggestion is because something likeVec<Vec<u8>>
has a lot of overhead, andVec<[u8]>
is not allowed by Rust.Binary
instead ofFixedSizeBinary
.228 is partially motivated by this issue, and may make this issue a bit more ergonomic. However, working on them in parallel will likely lead to some branch conflict, so pay attention to that issue.
=
) and inequality (!=
). This is because there is no way to add, subtract, etc. between binary data. Eventually, we may wish to add bitwise operations, but those are beyond the scope of this issue.