From aafabb7cf7ff3a93c89044aaf52f857f78b0b3f4 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 17 Sep 2024 09:49:33 +0000 Subject: [PATCH 1/2] Update testing documentation --- scripts/test_doc/test_documentation.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/test_doc/test_documentation.md b/scripts/test_doc/test_documentation.md index c08c00038b..1f5544bec5 100644 --- a/scripts/test_doc/test_documentation.md +++ b/scripts/test_doc/test_documentation.md @@ -87,10 +87,10 @@ [TestSlashPacketAcknowledgement](../../tests/integration/slashing.go#L186) | TestSlashPacketAcknowledgement tests the handling of a slash packet acknowledgement.
Details* Set up a provider and consumer chain, with channel initialization between them performed.
* Send a slash packet with randomized fields from the consumer to the provider.
* The provider processes the packet
| [TestHandleSlashPacketDowntime](../../tests/integration/slashing.go#L237) | TestHandleSlashPacketDowntime tests the handling of a downtime related slash packet, with integration tests.
Details* Retrieve a validator from provider chain's validators and checks if it's bonded.
* Set tThe signing information for the validator.
* The provider processes the downtime slashing packet from the consumer.
* Check that the validator has been jailed as a result of the downtime slashing packet being processed.
* Verify that the validator’s signing information is updated and that the jailing duration is set correctly.

Note that only downtime slash packets are processed by HandleSlashPacket.
| [TestOnRecvSlashPacketErrors](../../tests/integration/slashing.go#L283) | TestOnRecvSlashPacketErrors tests errors for the OnRecvSlashPacket method in an integration testing setting.
Details* Set up all CCV channels and expect panic if the channel is not established via dest channel of packet.
* After the correct channelID is added to the packet, a panic shouldn't occur anymore.
* Create an instance of SlashPacketData and then verify correct processing and error handling
for slashing packets received by the provider chain.
| - [TestValidatorDowntime](../../tests/integration/slashing.go#L391) | TestValidatorDowntime tests if a slash packet is sent and if the outstanding slashing flag is switched when a validator has downtime on the slashing module.
Details* Set up all CCV channel and send an empty VSC packet, then retrieve the address of a validator.
* Validator signs blocks for the duration of the signedBlocksWindow and a slash packet is constructed to be sent and committed.
* Simulate the validator missing blocks and then verify that the validator is jailed and the jailed time is correctly updated.
* Ensure that the missed block counters are reset.
* Check that there is a pending slash packet in the queue, and then send the pending packets.
* Check if slash record is created and verify that the consumer queue still contains the packet since no
acknowledgment has been received from the provider.
* Verify that the slash packet was sent and check that the outstanding slashing flag prevents the jailed validator to keep missing block.
| - [TestValidatorDoubleSigning](../../tests/integration/slashing.go#L511) | TestValidatorDoubleSigning tests if a slash packet is sent when a double-signing evidence is handled by the evidence module.
Details* Set up all CCV channel and send an empty VSC packet.
* Create a validator public key and address.
* Set the infraction parameters and create evidence of double signing.
* Add validator signing-info are also to the store and construct the slash packet.
* Simulate double signing and sends the slash packet.
* Verify the handling of slash packet, and check if slash record was created and if it's waiting for reply.
* Confirm that the queue is not cleared and the slash packet is sent.
| - [TestQueueAndSendSlashPacket](../../tests/integration/slashing.go#L605) | TestQueueAndSendSlashPacket tests the integration of QueueSlashPacket with SendPackets. In normal operation slash packets are queued in BeginBlock and sent in EndBlock.
Details* Set up all CCV channels and then queue slash packets for both downtime and double-signing infractions.
* Check that the correct number of slash requests are stored in the queue, including duplicates for downtime infractions.
* Prepare the CCV channel for sending actual slash packets.
* Send the slash packets and check that the outstanding downtime flags are correctly set for validators that were slashed
for downtime infractions.
* Ensure that the pending data packets queue is empty.
| - [TestCISBeforeCCVEstablished](../../tests/integration/slashing.go#L690) | TestCISBeforeCCVEstablished tests that the consumer chain doesn't panic or have any undesired behavior when a slash packet is queued before the CCV channel is established. Then once the CCV channel is established, the slash packet should be sent soon after.
Details* Check that no pending packets exist and that there's no slash record found.
* Triggers a slashing event which queues a slash packet.
* The slash packet should be queued but not sent, and it should stay like that until the CCV channel is established and the packet is sent.
*Verify that a slashing record now exists, indicating that the slashing packet has been successfully sent.
| + [TestValidatorDowntime](../../tests/integration/slashing.go#L401) | TestValidatorDowntime tests if a slash packet is sent and if the outstanding slashing flag is switched when a validator has downtime on the slashing module.
Details* Set up all CCV channel and send an empty VSC packet, then retrieve the address of a validator.
* Validator signs blocks for the duration of the signedBlocksWindow and a slash packet is constructed to be sent and committed.
* Simulate the validator missing blocks and then verify that the validator is jailed and the jailed time is correctly updated.
* Ensure that the missed block counters are reset.
* Check that there is a pending slash packet in the queue, and then send the pending packets.
* Check if slash record is created and verify that the consumer queue still contains the packet since no
acknowledgment has been received from the provider.
* Verify that the slash packet was sent and check that the outstanding slashing flag prevents the jailed validator to keep missing block.
| + [TestValidatorDoubleSigning](../../tests/integration/slashing.go#L521) | TestValidatorDoubleSigning tests if a slash packet is sent when a double-signing evidence is handled by the evidence module.
Details* Set up all CCV channel and send an empty VSC packet.
* Create a validator public key and address.
* Set the infraction parameters and create evidence of double signing.
* Add validator signing-info are also to the store and construct the slash packet.
* Simulate double signing and sends the slash packet.
* Verify the handling of slash packet, and check if slash record was created and if it's waiting for reply.
* Confirm that the queue is not cleared and the slash packet is sent.
| + [TestQueueAndSendSlashPacket](../../tests/integration/slashing.go#L615) | TestQueueAndSendSlashPacket tests the integration of QueueSlashPacket with SendPackets. In normal operation slash packets are queued in BeginBlock and sent in EndBlock.
Details* Set up all CCV channels and then queue slash packets for both downtime and double-signing infractions.
* Check that the correct number of slash requests are stored in the queue, including duplicates for downtime infractions.
* Prepare the CCV channel for sending actual slash packets.
* Send the slash packets and check that the outstanding downtime flags are correctly set for validators that were slashed
for downtime infractions.
* Ensure that the pending data packets queue is empty.
| + [TestCISBeforeCCVEstablished](../../tests/integration/slashing.go#L700) | TestCISBeforeCCVEstablished tests that the consumer chain doesn't panic or have any undesired behavior when a slash packet is queued before the CCV channel is established. Then once the CCV channel is established, the slash packet should be sent soon after.
Details* Check that no pending packets exist and that there's no slash record found.
* Triggers a slashing event which queues a slash packet.
* The slash packet should be queued but not sent, and it should stay like that until the CCV channel is established and the packet is sent.
*Verify that a slashing record now exists, indicating that the slashing packet has been successfully sent.
| # [stop_consumer.go](../../tests/integration/stop_consumer.go) From 6025b56d9d00d0d50507d64728c75c71f83fe94d Mon Sep 17 00:00:00 2001 From: kirdatatjana <116630536+kirdatatjana@users.noreply.github.com> Date: Tue, 17 Sep 2024 11:52:56 +0200 Subject: [PATCH 2/2] Update .github/workflows/testing-docs.yml Co-authored-by: Marius Poke --- .github/workflows/testing-docs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/testing-docs.yml b/.github/workflows/testing-docs.yml index 7a1f4797e7..bee1c4cf03 100644 --- a/.github/workflows/testing-docs.yml +++ b/.github/workflows/testing-docs.yml @@ -41,6 +41,7 @@ jobs: run: make testing-docs - name: Check for changes + if: env.GIT_DIFF id: check_changes run: | git show HEAD:scripts/test_doc/test_documentation.md > committed_file.md