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

indexer alt: integrate tempDB #20115

Merged
merged 4 commits into from
Nov 1, 2024
Merged

Conversation

gegaowp
Copy link
Contributor

@gegaowp gegaowp commented Oct 31, 2024

Description

title to unblock committer related tests including some test utils for those tests.

Test plan

  • modified smoketest of tempdb
  • added test for reset_database without running migrations

Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • Indexer:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:
  • REST API:

Copy link

vercel bot commented Oct 31, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2024 3:02pm
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Nov 1, 2024 3:02pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Nov 1, 2024 3:02pm
sui-typescript-docs ⬜️ Ignored (Inspect) Visit Preview Nov 1, 2024 3:02pm

@@ -25,6 +25,7 @@ prometheus.workspace = true
reqwest.workspace = true
serde.workspace = true
telemetry-subscribers.workspace = true
tempfile.workspace = true
Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved here for TempDB, which is better without #[cfg(test)]

crates/sui-indexer-alt/src/tempdb.rs Outdated Show resolved Hide resolved
Copy link
Member

@amnn amnn left a comment

Choose a reason for hiding this comment

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

Looks good, thanks @gegaowp -- main thing I'd like to see is whether we can avoid duplicating the config defaults (cc @bmwill in case you have any tricks here...), otherwise the other main comment is about file order and position for tempdb.rs, the file structure we use in sui-indexer-alt is:

  • imports
  • exports
  • modules
  • consts
  • types
  • impl blocks
  • trait impl blocks (more generic trait impls go last)
  • free functions
  • tests

In each section elements are ordered in decreasing order of visibility (pub, pub(crate), ..., to private).

crates/sui-indexer-alt/src/lib.rs Outdated Show resolved Hide resolved
crates/sui-indexer-alt/src/tempdb.rs Outdated Show resolved Hide resolved
crates/sui-indexer-alt/src/tempdb.rs Outdated Show resolved Hide resolved
crates/sui-indexer-alt/src/tempdb.rs Outdated Show resolved Hide resolved
crates/sui-indexer-alt/src/tempdb.rs Outdated Show resolved Hide resolved
crates/sui-indexer-alt/src/db.rs Show resolved Hide resolved
crates/sui-indexer-alt/src/db.rs Outdated Show resolved Hide resolved
@gegaowp
Copy link
Contributor Author

gegaowp commented Oct 31, 2024

revised pr and resolved comments except the duplicate default value.

@gegaowp gegaowp requested a review from amnn October 31, 2024 17:39
Copy link
Member

@amnn amnn left a comment

Choose a reason for hiding this comment

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

Looks great, thanks @gegaowp! Some minor comments, but I'm pretty happy with the const-based pattern for avoiding duplicate defaults -- thanks for that @bmwill.

crates/sui-indexer-alt/src/db.rs Outdated Show resolved Hide resolved
crates/sui-pg-temp-db/src/lib.rs Show resolved Hide resolved
@gegaowp gegaowp temporarily deployed to sui-typescript-aws-kms-test-env November 1, 2024 15:00 — with GitHub Actions Inactive
@gegaowp gegaowp merged commit ae9d809 into MystenLabs:main Nov 1, 2024
48 checks passed
@gegaowp gegaowp deleted the tempdb-idx-alt branch November 1, 2024 16:04
lxfind pushed a commit that referenced this pull request Nov 5, 2024
## Description 

title to unblock committer related tests including some test utils for
those tests.

## Test plan 

- modified smoketest of tempdb
- added test for reset_database without running migrations

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] Indexer: 
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
- [ ] REST API:
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.

3 participants