Skip to content

Conversation

haraldh
Copy link
Contributor

@haraldh haraldh commented Mar 24, 2025

What ❔

Update the tee_proof_generation_details by selecting by l1_batch_number AND tee_type.

Why ❔

Updating tee_type does not work because it is a primary key.

Indexes:
    "tee_proof_generation_details_pkey" PRIMARY KEY, btree (l1_batch_number, tee_type)
Query save_proof_artifacts_metadata(tee_type=Tdx, pubkey=[…], l1_batch_number=650000)
called at /usr/src/zksync/core/lib/dal/src/tee_proof_generation_dal.rs:225
[requested by `tee_request_processor` at node/proof_data_handler/src/tee_proof_api/processor.rs:186]
has resulted in error: error returned from database:
duplicate key value violates unique constraint "tee_proof_generation_details_pkey"

Is this a breaking change?

  • Yes
  • No

Operational changes

Checklist

  • PR title corresponds to the body of PR (we generate changelog entries from PRs).
  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • Code has been formatted via zkstack dev fmt and zkstack dev lint.

Copy link

@LLBlumire LLBlumire left a comment

Choose a reason for hiding this comment

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

Assuming we're confident in the premise (that selecting by tee_type is appropriate behaviour, over setting it) LGTM

PS: I dislike that this is using implicitly typed inline sql, over using query_file_as or similar to ensure changes don't cause unexpected typing changes and to enable better file support for the SQL. But that's a separate discussion and a refactor for another time

Update the `tee_proof_generation_details` by selecting by `l1_batch_number` AND `tee_type`.
Updating `tee_type` does not work because it is a primary key.

```
Indexes:
    "tee_proof_generation_details_pkey" PRIMARY KEY, btree (l1_batch_number, tee_type)
```

```
Query save_proof_artifacts_metadata(tee_type=Tdx, pubkey=[…], l1_batch_number=650000)
called at /usr/src/zksync/core/lib/dal/src/tee_proof_generation_dal.rs:225
[requested by `tee_request_processor` at node/proof_data_handler/src/tee_proof_api/processor.rs:186]
has resulted in error: error returned from database:
duplicate key value violates unique constraint "tee_proof_generation_details_pkey"
```

Signed-off-by: Harald Hoyer <harald@matterlabs.dev>
@haraldh haraldh force-pushed the hh/tee/save_proof_artifacts_metadata branch from 204f62e to 438f3ea Compare March 24, 2025 13:14
@haraldh haraldh enabled auto-merge March 24, 2025 15:22
@haraldh haraldh requested a review from LLBlumire March 24, 2025 15:35
@haraldh haraldh disabled auto-merge March 24, 2025 19:31
@haraldh haraldh added this pull request to the merge queue Mar 25, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 25, 2025
@haraldh haraldh added this pull request to the merge queue Mar 25, 2025
Merged via the queue into main with commit ed4926f Mar 25, 2025
37 checks passed
@haraldh haraldh deleted the hh/tee/save_proof_artifacts_metadata branch March 25, 2025 14:29
github-merge-queue bot pushed a commit that referenced this pull request Mar 27, 2025
🤖 I have created a release *beep* *boop*
---


##
[27.1.0](core-v27.0.0...core-v27.1.0)
(2025-03-27)


### Features

* **consensus:** Add consensus protocol versioning
([#3720](#3720))
([d1b4308](d1b4308))
* **zkos:** Implement ZK OS tree manager
([#3730](#3730))
([efc0007](efc0007))


### Bug Fixes

* **api:** Fix panic applying nonce override
([#3748](#3748))
([944059b](944059b))
* **contract_verifier:** order deploy events in
`get_contract_info_for_verification`
([#3766](#3766))
([6e3c031](6e3c031))
* make proof data handler backwards compatible
([#3767](#3767))
([bdbbaaa](bdbbaaa))
* **proof_data_handler:** update save_proof_artifacts_metadata UPDATE
([#3758](#3758))
([ed4926f](ed4926f))
* **vm:** Fix VM divergence in revert data
([#3570](#3570))
([b82e2e4](b82e2e4))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: zksync-era-bot <zksync-era-bot@users.noreply.github.com>
zkzoomer pushed a commit that referenced this pull request Jun 21, 2025
🤖 I have created a release *beep* *boop*
---


##
[27.1.0](core-v27.0.0...core-v27.1.0)
(2025-03-27)


### Features

* **consensus:** Add consensus protocol versioning
([#3720](#3720))
([1e3d17e](1e3d17e))
* **zkos:** Implement ZK OS tree manager
([#3730](#3730))
([efc0007](efc0007))


### Bug Fixes

* **api:** Fix panic applying nonce override
([#3748](#3748))
([944059b](944059b))
* **contract_verifier:** order deploy events in
`get_contract_info_for_verification`
([#3766](#3766))
([6e3c031](6e3c031))
* make proof data handler backwards compatible
([#3767](#3767))
([d7b0122](d7b0122))
* **proof_data_handler:** update save_proof_artifacts_metadata UPDATE
([#3758](#3758))
([ed4926f](ed4926f))
* **vm:** Fix VM divergence in revert data
([#3570](#3570))
([b82e2e4](b82e2e4))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: zksync-era-bot <zksync-era-bot@users.noreply.github.com>
dutterbutter pushed a commit to dutterbutter/zkstack-cli that referenced this pull request Jul 3, 2025
🤖 I have created a release *beep* *boop*
---


##
[27.1.0](matter-labs/zksync-era@core-v27.0.0...core-v27.1.0)
(2025-03-27)


### Features

* **consensus:** Add consensus protocol versioning
([#3720](matter-labs/zksync-era#3720))
([15771c5](matter-labs/zksync-era@15771c5))
* **zkos:** Implement ZK OS tree manager
([#3730](matter-labs/zksync-era#3730))
([efc0007](matter-labs/zksync-era@efc0007))


### Bug Fixes

* **api:** Fix panic applying nonce override
([#3748](matter-labs/zksync-era#3748))
([944059b](matter-labs/zksync-era@944059b))
* **contract_verifier:** order deploy events in
`get_contract_info_for_verification`
([#3766](matter-labs/zksync-era#3766))
([6e3c031](matter-labs/zksync-era@6e3c031))
* make proof data handler backwards compatible
([#3767](matter-labs/zksync-era#3767))
([c1788df](matter-labs/zksync-era@c1788df))
* **proof_data_handler:** update save_proof_artifacts_metadata UPDATE
([#3758](matter-labs/zksync-era#3758))
([ed4926f](matter-labs/zksync-era@ed4926f))
* **vm:** Fix VM divergence in revert data
([#3570](matter-labs/zksync-era#3570))
([b82e2e4](matter-labs/zksync-era@b82e2e4))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: zksync-era-bot <zksync-era-bot@users.noreply.github.com>
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