summary refs log tree commit diff
path: root/tests/storage/test_event_chain.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Handle large chain calc better (#17291)" (#17334)Erik Johnston2024-06-191-8/+1
| | | | | | This reverts commit bdf82efea505c488953b46eb681b5a63c4e9655d (#17291) This seems to have stopped persisting auth chains for new events, and so is causing state res to fall back to the slow methods
* Handle large chain calc better (#17291)Erik Johnston2024-06-191-1/+8
| | | | | We calculate the auth chain links outside of the main persist event transaction to ensure that we do not block other event sending during the calculation.
* Add `event.internal_metadata.instance_name` (#17300)Eric Eastwood2024-06-131-0/+1
| | | | | | | | | | Add `event.internal_metadata.instance_name` (the worker instance that persisted the event) to go alongside the existing `event.internal_metadata.stream_ordering`. `instance_name` is useful to properly compare and query for events with a token since you need to compare both the `stream_ordering` and `instance_name` against the vector clock/`instance_map` in the `RoomStreamToken`. This is pre-requisite work and may be used in https://github.com/element-hq/synapse/pull/17293 Adding `event.internal_metadata.instance_name` was first mentioned in the initial Sliding Sync PR while pairing with @erikjohnston, see https://github.com/element-hq/synapse/pull/17187/commits/09609cb0dbca3a4cfd9fbf90cc962e765ec469c0#diff-5cd773fb307aa754bd3948871ba118b1ef0303f4d72d42a2d21e38242bf4e096R405-R410
* Fix GHSA-3h7q-rfh9-xm4vErik Johnston2024-04-231-31/+73
| | | | | | | | | | | | | | Weakness in auth chain indexing allows DoS from remote room members through disk fill and high CPU usage. A remote Matrix user with malicious intent, sharing a room with Synapse instances before 1.104.1, can dispatch specially crafted events to exploit a weakness in how the auth chain cover index is calculated. This can induce high CPU consumption and accumulate excessive data in the database of such instances, resulting in a denial of service. Servers in private federations, or those that do not federate, are not affected.
* Correctly mention previous copyright (#16820)Erik Johnston2024-01-231-0/+1
| | | | | During the migration the automated script to update the copyright headers accidentally got rid of some of the existing copyright lines. Reinstate them.
* Update license headersPatrick Cloke2023-11-211-10/+16
|
* Convert simple_select_many_batch, simple_select_many_txn to tuples. (#16444)Patrick Cloke2023-10-111-26/+38
|
* Update ruff config (#16283)Patrick Cloke2023-09-081-3/+3
| | | Enable additional checks & clean-up unneeded configuration.
* Replace `EventContext` fields `prev_group` and `delta_ids` with field ↵Shay2023-06-131-1/+4
| | | | `state_group_deltas` (#15233)
* Batch up storing state groups when creating new room (#14918)Shay2023-02-241-2/+4
|
* Bump black from 22.12.0 to 23.1.0 (#15103)dependabot[bot]2023-02-221-2/+0
|
* Add final type hint to tests.unittest. (#15072)Patrick Cloke2023-02-141-2/+8
| | | | Adds a return type to HomeServerTestCase.make_homeserver and deal with any variables which are no longer Any.
* Require types in tests.storage. (#14646)Patrick Cloke2022-12-091-12/+17
| | | | Adds missing type hints to `tests.storage` package and does not allow untyped definitions.
* Persist CreateRoom events to DB in a batch (#13800)Shay2022-09-281-2/+6
|
* Rename storage classes (#12913)Erik Johnston2022-05-311-1/+2
|
* Refactor `EventContext` (#12689)Erik Johnston2022-05-101-1/+1
| | | | | | | | | | Refactor how the `EventContext` class works, with the intention of reducing the amount of state we fetch from the DB during event processing. The idea here is to get rid of the cached `current_state_ids` and `prev_state_ids` that live in the `EventContext`, and instead defer straight to the database (and its caching). One change that may have a noticeable effect is that we now no longer prefill the `get_current_state_ids` cache on a state change. However, that query is relatively light, since its just a case of reading a table from the DB (unlike fetching state at an event which is more heavyweight). For deployments with workers this cache isn't even used. Part of #12684
* Remove `HomeServer.get_datastore()` (#12031)Richard van der Hoff2022-02-231-2/+2
| | | | | | | The presence of this method was confusing, and mostly present for backwards compatibility. Let's get rid of it. Part of #11733
* Add `state_key` and `rejection_reason` to `events` (#11792)Richard van der Hoff2022-01-211-1/+4
| | | | ... and start populating them for new events
* Make background updates controllable via a plugin (#11306)Erik Johnston2021-11-291-2/+2
| | | Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
* Don't drop user dir deltas when server leaves room (#10982)David Robertson2021-10-061-12/+2
| | | | | | | | | Fix a long-standing bug where a batch of user directory changes would be silently dropped if the server left a room early in the batch. * Pull out `wait_for_background_update` in tests Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com> Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* Flatten the synapse.rest.client package (#10600)reivilibre2021-08-171-1/+1
|
* Remove redundant "coding: utf-8" lines (#9786)Jonathan de Jong2021-04-141-1/+0
| | | | | | | Part of #9744 Removes all redundant `# -*- coding: utf-8 -*-` lines from files, as python 3 automatically reads source code as utf-8 now. `Signed-off-by: Jonathan de Jong <jonathan@automatia.nl>`
* Update black, and run auto formatting over the codebase (#9381)Eric Eastwood2021-02-161-9/+14
| | | | | | | - Update black version to the latest - Run black auto formatting over the codebase - Run autoformatting according to [`docs/code_style.md `](https://github.com/matrix-org/synapse/blob/80d6dc9783aa80886a133756028984dbf8920168/docs/code_style.md) - Update `code_style.md` docs around installing black to use the correct version
* Make chain cover index bg update go faster (#9124)Erik Johnston2021-01-151-31/+186
| | | | | | We do this by allowing a single iteration to process multiple rooms at a time, as there are often a lot of really tiny rooms, which can massively slow things down.
* Add background update for add chain cover index (#9029)Erik Johnston2021-01-141-0/+114
|
* Use a chain cover index to efficiently calculate auth chain difference (#8868)Erik Johnston2021-01-111-0/+472