Skip to content

sui_v0.34.0_1682393052_ci

@healthydeve healthydeve tagged this 25 Apr 02:23
## Description 

Originally the key, value for rocks db pairing are indexed in such a way
that they are lexographically organized.
(i.e:
 (package, module, function)
 (abc, abc, abc), (abc, bcd, abc), (abc, cde, abc), (abc, cde, bcd)
).

this means when we pass in a null string, to find a key like so: (abc,
'','') it will skip to the end of the DB, and show that there are no
entries at all. This type of indexing caused issues in pagination
whenever we pass in reverse = True because it will first skip to a
different place in the DB. In this PR, we address those underlying
issues and ensure that the DB will iterate backwards properly when using
the filter portion of the `MoveFunction` filter type.

## Test Plan 
Checked that we cannot publish modules / function with names too long
locally.

![image](https://user-images.githubusercontent.com/123408603/233707313-1d66b2a0-95e9-486e-af00-fb65697b4394.png)


False with nulls: 

![image](https://user-images.githubusercontent.com/123408603/233476254-164a1b36-c6fe-481c-804d-11510c25c2ac.png)

True with nulls:

![image](https://user-images.githubusercontent.com/123408603/233476444-c95c27e6-3ca6-488f-9ea3-459a624c49ef.png)


![image](https://user-images.githubusercontent.com/123408603/233477916-2220e15c-ed66-4085-9141-35232cbd1c59.png)
Sui system behavior works as intended
---
If your changes are not user-facing and not a breaking change, you can
skip the following section. Otherwise, please indicate what changed, and
then add to the Release Notes section as highlighted during the release
process.

### Type of Change (Check all that apply)

- [ ] user-visible impact
- [ ] breaking change for a client SDKs
- [ ] breaking change for FNs (FN binary must upgrade)
- [ ] breaking change for validators or node operators (must upgrade
binaries)
- [ ] breaking change for on-chain data layout
- [ ] necessitate either a data wipe or data migration

### Release notes

---------

Co-authored-by: ade <ade@mystenlabs.com>
Assets 2
Loading