|
36 | 36 | import synapse.metrics |
37 | 37 | from synapse.api.constants import EventContentFields, EventTypes, RelationTypes |
38 | 38 | from synapse.api.room_versions import RoomVersions |
39 | | -from synapse.crypto.event_signing import compute_event_reference_hash |
40 | 39 | from synapse.events import EventBase # noqa: F401 |
41 | 40 | from synapse.events.snapshot import EventContext # noqa: F401 |
42 | 41 | from synapse.storage._base import db_to_json, make_in_list_sql_clause |
@@ -1600,11 +1599,6 @@ def _update_metadata_tables_txn( |
1600 | 1599 | inhibit_local_membership_updates=inhibit_local_membership_updates, |
1601 | 1600 | ) |
1602 | 1601 |
|
1603 | | - # Insert event_reference_hashes table. |
1604 | | - self._store_event_reference_hashes_txn( |
1605 | | - txn, [event for event, _ in events_and_contexts] |
1606 | | - ) |
1607 | | - |
1608 | 1602 | # Prefill the event cache |
1609 | 1603 | self._add_to_cache(txn, events_and_contexts) |
1610 | 1604 |
|
@@ -1704,25 +1698,6 @@ def _insert_event_expiry_txn(self, txn, event_id, expiry_ts): |
1704 | 1698 | values={"event_id": event_id, "expiry_ts": expiry_ts}, |
1705 | 1699 | ) |
1706 | 1700 |
|
1707 | | - def _store_event_reference_hashes_txn(self, txn, events): |
1708 | | - """Store a hash for a PDU |
1709 | | - Args: |
1710 | | - txn (cursor): |
1711 | | - events (list): list of Events. |
1712 | | - """ |
1713 | | - |
1714 | | - vals = [] |
1715 | | - for event in events: |
1716 | | - ref_alg, ref_hash_bytes = compute_event_reference_hash(event) |
1717 | | - vals.append((event.event_id, ref_alg, memoryview(ref_hash_bytes))) |
1718 | | - |
1719 | | - self.db_pool.simple_insert_many_txn( |
1720 | | - txn, |
1721 | | - table="event_reference_hashes", |
1722 | | - keys=("event_id", "algorithm", "hash"), |
1723 | | - values=vals, |
1724 | | - ) |
1725 | | - |
1726 | 1701 | def _store_room_members_txn( |
1727 | 1702 | self, txn, events, *, inhibit_local_membership_updates: bool = False |
1728 | 1703 | ): |
|
0 commit comments