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

dev: add migration procedure for the MongoDB [2] #1293

Open
3 tasks
greged93 opened this issue Jul 15, 2024 · 2 comments
Open
3 tasks

dev: add migration procedure for the MongoDB [2] #1293

greged93 opened this issue Jul 15, 2024 · 2 comments
Labels
enhancement Enhancement of the code, not introducing new features.

Comments

@greged93
Copy link
Contributor

greged93 commented Jul 15, 2024

Describe the enhancement request

Indexes have been added to the Mongo but we should have some migration procedure from Karnot in case we ever want to update these or change the Mongo models. This needs to be discussed with Karnot.

Tasks

db.headers.getIndexes()
[
  { v: 2, key: { _id: 1 }, name: '_id_' },
  { v: 2, key: { 'header.hash': 1 }, name: 'header.hash_1' },
  { v: 2, key: { 'header.number': 1 }, name: 'header.number_1' },
  { v: 2, key: { '_cursor.from': 1 }, name: '_cursor.from_1' },
  { v: 2, key: { '_cursor.to': 1 }, name: '_cursor.to_1' }
]

db.receipts.getIndexes()
[
  { v: 2, key: { _id: 1 }, name: '_id_' },
  {
    v: 2,
    key: { 'receipt.blockHash': 1 },
    name: 'receipt.blockHash_1'
  },
  {
    v: 2,
    key: { 'receipt.blockNumber': 1 },
    name: 'receipt.blockNumber_1'
  },
  {
    v: 2,
    key: { 'receipt.transactionHash': 1 },
    name: 'receipt.transactionHash_1'
  },
  { v: 2, key: { '_cursor.from': 1 }, name: '_cursor.from_1' },
  { v: 2, key: { '_cursor.to': 1 }, name: '_cursor.to_1' }
]

db.transactions.getIndexes()

[
  { v: 2, key: { _id: 1 }, name: '_id_' },
  { v: 2, key: { 'tx.blockHash': 1 }, name: 'tx.blockHash_1' },
  { v: 2, key: { 'tx.blockNumber': 1 }, name: 'tx.blockNumber_1' },
  { v: 2, key: { '_cursor.from': 1 }, name: '_cursor.from_1' },
  { v: 2, key: { 'tx.hash': 1 }, name: 'tx.hash_1' },
  { v: 2, key: { '_cursor.to': 1 }, name: '_cursor.to_1' }
]

db.logs.getIndexes()
[
  { v: 2, key: { _id: 1 }, name: '_id_' },
  { v: 2, key: { '_cursor.from': 1 }, name: '_cursor.from_1' },
  { v: 2, key: { '_cursor.to': 1 }, name: '_cursor.to_1' }
]
@greged93 greged93 added the enhancement Enhancement of the code, not introducing new features. label Jul 15, 2024
@github-project-automation github-project-automation bot moved this to 🆕 Backlog in Kakarot on Starknet Jul 15, 2024
anukkrit149 pushed a commit to karnotxyz/kakarot-rpc that referenced this issue Aug 9, 2024
<!--- Please provide a general summary of your changes in the title
above -->

<!-- Give an estimate of the time you spent on this PR in terms of work
days.
Did you spend 0.5 days on this PR or rather 2 days?  -->

Time spent on this PR:

## Pull request type

<!-- Please try to limit your pull request to one type,
submit multiple pull requests if needed. -->

Please check the type of change your PR introduces:

- [x] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, renaming)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] Documentation content changes
- [ ] Other (please describe):

## What is the current behavior?

Do not assert the value is 0 at the end of load_bytecode leading to
prover being able to

Resolves kkrt-labs#1279, resolves kkrt-labs#1293

## What is the new behavior?
assert value is 0 at the end of load_bytecode

<!-- Reviewable:start -->
- - -
This change is [<img src="https://reviewable.io/review_button.svg"
height="34" align="absmiddle"
alt="Reviewable"/>](https://reviewable.io/reviews/kkrt-labs/kakarot/1290)
<!-- Reviewable:end -->

---------

Co-authored-by: Clément Walter <[email protected]>
@greged93
Copy link
Contributor Author

greged93 commented Oct 1, 2024

@anukkrit149 is this still needed?

@Eikix
Copy link
Member

Eikix commented Oct 22, 2024

This issue needs scoping cc'ing @ClementWalter, as it has been mentioned now twice in Karnot weeklies, we need a MongoDB migration script that's ran every time we redeploy the mongoDB

There is a task in Notion mentioning this issue

@Eikix Eikix moved this from 🆕 Backlog to 📅 Next sprint in Kakarot on Starknet Oct 22, 2024
@ClementWalter ClementWalter moved this from 📅 Next sprint to 🔖 Current sprint in Kakarot on Starknet Nov 4, 2024
@ClementWalter ClementWalter changed the title dev: add migration procedure for the MongoDB dev: add migration procedure for the MongoDB [2] Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement of the code, not introducing new features.
Projects
No open projects
Status: 🔖 Current sprint
Development

No branches or pull requests

2 participants