Implement data structures and tests for checking transaction eligibility based on tx hash. This work will be continues in future PRs. All code added in this PR is only used in tests.
* feat: add simple txid-based eligibility check with hard-coded params (#3166)
* use new proc to generate eligibility status
Co-authored-by: gabrielmer <101006718+gabrielmer@users.noreply.github.com>
* minor fixes
* add comments to clarify eligibility definition
* use Address.fromHex conversion from eth-web3
* move isEligible to common
* refactor: avoid result and unnecesary branching
* define const for simple transfer gas usage
* avoid unnecessary parentheses
* chore: run nph linter manually
* refactor, move all hard-coded constants to tests
* use Result type in eligibility tests
* use standard method of error handling
* make try-block smaller
* add a try-block in case of connection failure to web3 provider
* make queries to web3 provider in parallel
* move Web3 provider RPC URL into env variable
* remove unused import
* rename functions
* use await in async proc
Co-authored-by: gabrielmer <101006718+gabrielmer@users.noreply.github.com>
* add timeout to tx receipt query
* parallelize queries for tx and txreceipt
* make test txids non public
Co-authored-by: Ivan FB <128452529+Ivansete-status@users.noreply.github.com>
* use assert in txid i13n test
Co-authored-by: Ivan FB <128452529+Ivansete-status@users.noreply.github.com>
* use parentheses when calling verb-methods without arguments
Co-authored-by: Ivan FB <128452529+Ivansete-status@users.noreply.github.com>
* remove unused import
Co-authored-by: Ivan FB <128452529+Ivansete-status@users.noreply.github.com>
* use init for stack-allocated objects
* add txReceipt error message to error
Co-authored-by: Ivan FB <128452529+Ivansete-status@users.noreply.github.com>
* introduce eligibility manager
* [WIP] use Anvil for eligibility testing
* add eligibility test with contract deployment tx
* add eligibility test with contract call
* add asyncSetup and asyncTeardown for eligibility tests
* minor refactor
* refactor tests for onchain group manager with asyncSetup and asyncTeardown
* minor refactor
* remove unnecessary defer in asyncTeardown
Co-authored-by: Ivan FB <128452529+Ivansete-status@users.noreply.github.com>
* remove unnecessary call in test (moved to asyncTeardown)
Co-authored-by: Ivan FB <128452529+Ivansete-status@users.noreply.github.com>
* add comment justidying the use of discard
* rename file txid_proof to eligibility_manager
---------
Co-authored-by: gabrielmer <101006718+gabrielmer@users.noreply.github.com>
Co-authored-by: Ivan FB <128452529+Ivansete-status@users.noreply.github.com>
* avoid compile TRACE level to reduce libwaku size
* waku_rln_relay/constants.nim: avoid adding constant seq that is used in tests only
* ci:yml USE_LIBBACKTRACE=0 to force -d:debug when running tests
* make lightpush return msg hash after successful publish
* libwaku avoid the use of string
* library alloc.nim allocate memory when nil cstring is passed
* libwaku store_request remove extra destroyShared(self)
* json_message_event: avoid converting a WakuMessageHash into 0x...
* waku_thread: wait until the waku thread completely received the request
* waku_thread: add missing deallocShared
* libwaku avoid nonsense onReceivedMessage cb in waku_relay_publish
* Fix receiver exit criteria, not let it wait forever in some cases, added a timely check from the last arrived message
* Extend dial and service usage failure metrics with agent string to reveal service nodes origins
* Adjusted infra testing content topic to be unique in the system
* Extend error logs with peer's agent string, fix exit criteria
* Add informative log for not waiting for more messages
* Add unknown as default for empty agent identifier
* better explain exit logic of receiver
* Address review comment - checking for last message arrival return Optional Moment instead of result - better explains what is happening.
* Adding lpt-runner script and assemble into liteprotocoltester image - to ease infra deployment
* Add supervisor that can run lpt continously in infra environment, infra.env defines defaults for run, in case image tag of lpt docker image is deploy it will build a specific image for infra deployment.
* Added message latency metrics
* DELAY_MESSAGES to MESSAGE_INTERVAL renaming
* Adjust name of START_PUBLISHING_AFTER
* Extend lpt readme with how to use make to build dockerized image and notice about infra deployment
* As fixed in discussion, we will control infra testing by built in predefined test setup
* Prevent peer switch in case using fixed service peers