shutter-network / encrypting-rpc-server

An Ethereum JSON RPC server for Shutterized Gnosis Chain that encrypts transactions
3 stars 0 forks source link

Stress test #13

Open konradkonrad opened 1 month ago

konradkonrad commented 1 month ago

This adds go test-runnable testcases to stress- and edge case-test a shutter on gnosis chain live system, in an end-to-end fashion. It does however not use the encrypting-rpc-server, but instead submits transactions directly to the sequencer contract.

As a pre-requisite, an account with sufficient "ETH" (or other gas tokens corresponding to the chain the system is deployed on) is required. Its private key needs to be available hex encoded in an environment variable STRESS_TEST_PK=0xcaffee….

The most notable test cases are

Most other test cases are very simple, and could be considered basic functionality "smoke tests".

Note: Due to the live nature of the test environment, not all PASSing tests can show the absence of errors. For example:

TestStressExceedEncryptedGasLimit 1) The test relies on a hardcoded value for the limit. If the parameters of the live system change, that value may be outdated. 2) The test shall PASS if not all transactions end in the same shutterized block. It can however happen, that an external entity also submitted transactions and therefore the assumed correct behavior happened only by chance.

Also: Since we have no insight to the validator, we rely on timeouts for waiting for transactions to be included on-chain. Additionally, we can not reliably check for failing transactions.

In short: this PR is to some extent ab-using the go test environment to allow us excecuting these tests.

There are also two special "Test…" functions, that do not test anything, but can be used for house keeping:

jannikluhn commented 3 weeks ago

Haven't reviewed yet, but I think this should be in a separate repository. Are you using a lot of code from the encrypting rpc server that would make this difficult?

fredo commented 3 weeks ago

Haven't reviewed yet, but I think this should be in a separate repository. Are you using a lot of code from the encrypting rpc server that would make this difficult?

Was going to ask the same. Does it make sense to put it into rolling shutter?

konradkonrad commented 2 weeks ago

Haven't reviewed yet, but I think this should be in a separate repository. Are you using a lot of code from the encrypting rpc server that would make this difficult?

I agree, and it should not be hard, I think the only bit of re-use that's left in there is rpc.ComputeIdentity.