-
Notifications
You must be signed in to change notification settings - Fork 94
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
[Indexer] Implements Field indexer #3282
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Files |
@popcnt1 help review |
|
Construct transactions through multi-signatures, submit new field indexer configurations, and field indexes will automatically take effect on the chain.
|
1540901
to
d52c7d5
Compare
let clonded_fileds = struct_def.field_defs; | ||
let clonded_fields = struct_def.field_defs; | ||
|
||
for field_def in clonded_fileds { | ||
for field_def in clonded_fields { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
third_party 下的代码最好不要修改。
pub id: ObjectIDView, | ||
pub field_key: String, | ||
pub name: String, | ||
pub value: StrView<u64>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里是不是应该把原始的 Object 从 state 中取出来? 这样 queryField 和 listField 返回结果就是一致的,然后把 u64 value 作为 sort_key 输出。如果后面增加了按 struct 中的某个字段来排序,也不用变这个结构。
另外后面可以默认用时间来排序,这样大多数场景也能满足需求。
Summary
Supports on-chain configuration of table handles, automatically indexes specified table elements, and sorts by fixed fields. Provides RPC API to query field index data.
At the same time, in the rooch db tool, the revert and rollback operations on the field indexer are supported.
The
rooch_queryFields
RPC API supports a new paging method, page+limit paging, which is different from the previous cursor+limit paging and can meet the needs of the grow voting list.TODO
bigint
only supports u64 at most, and does not support u128 and u256 for the time being. This will limit the use of coin holder lists. It is necessary to consider wrapping u128 and u256 to meet the sorting requirements of large numbers.