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

WIP Move Host DB to SQL Design #1782

Closed
wants to merge 10 commits into from
Closed

WIP Move Host DB to SQL Design #1782

wants to merge 10 commits into from

Conversation

badgersrus
Copy link
Contributor

WIP Just to confirm choices

* `rollupHash` PK
* `FirstBatchSeqNo`
* `LastBatchSeqNo`
* `L1BlockHash`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We may want to store the startTime in here as it will help contextualize the data when someones viewing on tenscan. Even though block height and sequence dictate the order, people still want to see what time they were executed.

Copy link
Collaborator

@tudor-malene tudor-malene left a comment

Choose a reason for hiding this comment

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

few clarifications needed

| **Block** | L1 Block Number | L1 Block Header |
| **Rollup** | L1 Block Hash | Rollup Header |
| **Rollup** | Rollup Hash | Rollup Header |
| **Transactions** | Transactions | Total number of transactions |
Copy link
Collaborator

Choose a reason for hiding this comment

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

what does the key "Transactions" mean here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's actually just a dummy key "t" so we can reference the total transaction count value see here. In the other schema keys we prefix the byte array of the keys with these but this is just a string key. Updated the table to better reflect this

design/host/host_db_requirements.md Outdated Show resolved Hide resolved
start_seq int NOT NULL,
end_seq int NOT NULL,
started_at int NOT NULL,
compression_block binary(16) NOT NULL
Copy link
Collaborator

Choose a reason for hiding this comment

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

what is the "compression_block"?
I assume it is the l1 block where it was included?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep this is the l1 block just using the same naming convention as the enclave db so its uniform

hash binary(16) primary key,
start_seq int NOT NULL,
end_seq int NOT NULL,
started_at int NOT NULL,
Copy link
Collaborator

Choose a reason for hiding this comment

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

"started_at" ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Corresponds to the CalldataRollupHeader.StartTime here. It's actually the time associated with the first batch in the rollup and im assuming we're using a unix timestamp as its represented by an int64

| **Rollup** | Rollup Hash | Rollup Header |
| **Transactions** | Transactions | Total number of transactions |

## Tenscan Functionality Requirements
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it's worth creating 2 lists.

First for the mainnet features.
And second for the extra features we want on testnet.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Have added a todo section for the xchain messaging and mainnet vs testnet since we can quickly hash this out next week in person

Copy link
Collaborator

Choose a reason for hiding this comment

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

I was thinking in terms of the "decryption" functionality, which is testnet specific.
This is a testnet feature:

  • Decrypt the encrypted TX blob

design/host/host_db_requirements.md Show resolved Hide resolved
Copy link
Contributor Author

@badgersrus badgersrus left a comment

Choose a reason for hiding this comment

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

Addressed your comments cheers @tudor-malene and beefed out the current table

hash binary(16) primary key,
start_seq int NOT NULL,
end_seq int NOT NULL,
started_at int NOT NULL,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Corresponds to the CalldataRollupHeader.StartTime here. It's actually the time associated with the first batch in the rollup and im assuming we're using a unix timestamp as its represented by an int64

| **Block** | L1 Block Number | L1 Block Header |
| **Rollup** | L1 Block Hash | Rollup Header |
| **Rollup** | Rollup Hash | Rollup Header |
| **Transactions** | Transactions | Total number of transactions |
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's actually just a dummy key "t" so we can reference the total transaction count value see here. In the other schema keys we prefix the byte array of the keys with these but this is just a string key. Updated the table to better reflect this

| **Rollup** | Rollup Hash | Rollup Header |
| **Transactions** | Transactions | Total number of transactions |

## Tenscan Functionality Requirements
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Have added a todo section for the xchain messaging and mainnet vs testnet since we can quickly hash this out next week in person

start_seq int NOT NULL,
end_seq int NOT NULL,
started_at int NOT NULL,
compression_block binary(16) NOT NULL
Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep this is the l1 block just using the same naming convention as the enclave db so its uniform

create table if not exists batch
(
sequence int primary key,
hash binary(16) NOT NULL unique,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we need the full_hash as well

@badgersrus badgersrus changed the title WIP Move Host DB to SQL Implementation WIP Move Host DB to SQL Design Feb 20, 2024
@badgersrus badgersrus closed this Apr 8, 2024
@badgersrus
Copy link
Contributor Author

Closing as this is superseded #1804

@badgersrus badgersrus deleted the will/sql-host-db branch April 11, 2024 15:33
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.

2 participants