Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Submitter and Retries for Fraud #1288

Merged
merged 12 commits into from Aug 31, 2023

Conversation

CryptoMaxPlanck
Copy link
Contributor

Description
Utilize the submitter and retries in the guard's fraud transactions.

@github-actions github-actions bot added go Pull requests that update Go code size/l labels Aug 28, 2023
@CryptoMaxPlanck CryptoMaxPlanck changed the base branch from master to feat/fraud-reports August 28, 2023 06:24
@codecov
Copy link

codecov bot commented Aug 28, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.03366% 🎉

Comparison is base (6ad19c1) 60.28025% compared to head (0b70afe) 60.31391%.

Additional details and impacted files
@@                     Coverage Diff                      @@
##           feat/fraud-reports       #1288         +/-   ##
============================================================
+ Coverage            60.28025%   60.31391%   +0.03365%     
============================================================
  Files                     566         566                 
  Lines                   34041       34022         -19     
  Branches                  276         276                 
============================================================
  Hits                    20520       20520                 
+ Misses                  11663       11647         -16     
+ Partials                 1858        1855          -3     
Flag Coverage Δ
cctp-relayer 65.98985% <ø> (+0.67682%) ⬆️
core 64.96173% <ø> (+0.31315%) ⬆️
ethergo 63.97380% <ø> (ø)
explorer 53.40488% <ø> (ø)
omnirpc 69.82429% <ø> (ø)
promexporter 41.02564% <ø> (ø)
release-copier-action 19.33333% <ø> (ø)
scribe 57.23494% <ø> (-0.13336%) ⬇️
tools 21.72452% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
agents/agents/guard/guard.go 78.23129% <ø> (ø)
agents/agents/notary/notary.go 56.93069% <ø> (-0.42225%) ⬇️
agents/config/agent_config.go 17.07317% <ø> (ø)
agents/domains/evm/bondingmanager.go 53.84615% <ø> (ø)
agents/domains/evm/inbox.go 52.17391% <ø> (ø)
agents/domains/evm/lightinbox.go 57.14286% <ø> (ø)
agents/domains/evm/lightmanager.go 62.06897% <ø> (+5.25079%) ⬆️
core/retry/retry.go 98.85057% <ø> (ø)

... and 8 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions github-actions bot added size/m and removed size/l labels Aug 28, 2023
@github-actions github-actions bot added size/l and removed size/m labels Aug 28, 2023
@CryptoMaxPlanck CryptoMaxPlanck changed the title Submitter for Fraud Submitter and Retries for Fraud Aug 29, 2023
@github-actions github-actions bot added size/m and removed size/l labels Aug 29, 2023
Copy link
Collaborator

@dwasse dwasse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM- a couple minor comments

@CryptoMaxPlanck CryptoMaxPlanck merged commit 7322033 into feat/fraud-reports Aug 31, 2023
60 of 64 checks passed
@CryptoMaxPlanck CryptoMaxPlanck deleted the feat/submitter-fraud branch August 31, 2023 20:07
dwasse added a commit that referenced this pull request Sep 13, 2023
* [goreleaser]

* up to calling submitStateReport

* barebones report invalid state in snapshot. need to update root PR

* make contract interfaces return txs for submitter

* [goreleaser]

* Cleanup: setup in parallel

* staging: working on fraud_test notary signature

* WIP: working thru fraud test

* WIP: working test

* Cleanup: remove logs

* Cleanup: more logs

* Fix: throw error for int64 overflow in EncodeState()

* WIP: fraud attestation handling

* WIP: add TestReportAttestationNotOnSummit

* WIP: testing. not getting log for submitAttestation event

* WIP, getting error of datahash code 0x184fb2df0de4da8049867b20a0d8b823d4590d0f3c9881144e53690eb2f67fe7

* WIP: successfully submitting fraudulent attestation. now debugging guards report

* WIP: working TestReportAttestationNotOnSummit

* Cleanup: test, remove logs

* Cleanup: remove GetAttestationComputeHash(), instead calculate hash as input

* Cleanup: remove unnecessary TestEncodeChainGasParity for now

* Cleanup: remove init() used for debugging lightinbox.metadata.go

* Cleanup: de-functionalize slashAccusedAgent() for consistency

* WIP: adding submitAttestationReport

* working submitattestationreport

* WIP: getting a signature for the STATE report

* small changes before handoff

* WIP: verifyStateWithAttestation case impl

* Feat: add TestReportFraudulentStateInAttestation

* staging. added a getter to the bondingmanager

* working test for fraudulentstateinattestation

* WIP: add receipt type with encoder

* WIP: add TestInvalidReceipt and handleReceipt impl

* CLEANME: added checks to test and start with tips encoding parity

* WIP: working case 1 of agnetStatusUpdate

* WIP: opendispute handling

* Cleanup: guard impl

* Cleanup: remove checks from event parser methods

* start of db implementation

* fix

* fillbytes

* fix

* staging

* Cleanup: remove printing reverts

* WIP: add getTestGuard() helper

* working receipt fraud test

* Cleanup: add bumpTx helper

* Cleanup: utilize AgentFlagType enum for AgentStatus.Flag values

* Cleanup: use getTestGuard() helper in all tests

* Cleanup: remove unnecessary test code

* Feat: add DisputeStatus type, GetDisputeStatus() call to BondingManager

* Feat: guard checks dispute status before submitting state report

* Cleanup: remove embedded lightinbox

* Cleanup: Domain -> AgentDomain

* WIP: verify agent status before slashing

* working multiple state case

* start to sql queries for crosstable dispute handling

* WIP: implement db queries and logic for updateAgentStatus() call

* WIP: fix cyclic deps

* Fix: build errs

* Add db tests

* wip: crosstable

* passing TestGetUpdateAgentStatusParameters

* working crosstable testrs

* WIP: add updateAgentStatuses()

* Feat: working anvil backend for fraud tests

* WIP: add evm.IncreaseTime() call

* clean and reformat query

* WIP: add bumpBackends()

* WIP: merge handling of DisputeOpened on remote / summit

* Cleanup: remove logs

* Fix: build

* Cleanup: some lints; guard parses RootUpdated events

* Cleanup: more lints

* Cleanup: remove unnecessary param in VerifyStateWithSnapshot()

* Cleanup: more lints

* Cleanup: more linting

* Cleanup: remove comments

* Cleanup: merge isStateSlashable() logic

* Cleanup: unused params

* Cleanup: another unused param

* Cleanup: move event parsers to utils.go

* Cleanup: move handlers to fraud.go

* Cleanup: add comments for fraud handlers

* Cleanup: comments

* De-duplicate agent signing logic (#1228)

* WIP: merge common signing logic into sign() util

* WIP: add Encoder interface for signed types

* Feat: add consts for salt values

* Cleanup: remove specific language from generic signEncoder func

* Fix: parity tests

* Cleanup: lint

* Fix: don't parse notary err on ctx cancel

* Cleanup: enable TestGuardE2E

* Cleanup: err msg

* Fix: ignore ctx cancel err  in agents integration test

* Fix: TestAgentsE2E

* Fix: avoid int64 overflow in executor tests

* Cleanup: resolve merge conflict

* Cleanup: merge conflict

* Feat: add NowFunc for time override

* WIP: executing mngr msg

* WIP: debugging GetLatestSummitBlockNumber()

* wip: friday progress

* Feat: add PassAgentRoot to destination interface

* WIP: parse RootUpdated on light manager, submit extra attestation and bump optimistic period on destination

* WIP: manually pass in agent root in last attestation

* Feat: guard db uses GetBlockNumberForRoot()

* WIP: working test

* Feat: correct block number condition

* Cleanup: remove logs

* Cleanup: more logs

* Cleanup: more cleanup

* Cleanup: remove unnecessary event parsing, re enable guard submitter

* add GetSummitBlockNumberForRoot test

* Cleanup: logs

* Fix: re enable submitter in notary

* Cleanup: go mod tidy

* small lint

* reduce again

* support for remote scribe in guard commands

* trivial fixes

* Fix: retry contract deployment

* Extra state reports (#1287)

* Feat: submit state reports to remote chains

* Feat: add SubmitStateReportWithAttestation on LightInbox

* WIP: verify number of reports on agent domain

* Feat: add prepareStateReport() for all report submissions

* Feat: add working state report verification to TestReportFraudulentStateInAttestation

* Feat: add verifyStateReport() helper

* Feat: add verifyStateReport() helper

* WIP: add RelayableAgentStatus model

* Cleanup: remove unused dispute handling

* WIP: working TestFraudulentStateInSnapshot with new agent status model

* WIP: fix crosstable logic, logs

* Feat: add NotaryOnDestination to test setup

* WIP: working test with NotaryOnDestination and Order clause in db query

* Cleanup: logs, dead code

* Fix: db tests

* Cleanup: lints

* Cleanup: remove Debug() gorm flags

* Feat: add updateAgentStatus() test helper

* Cleanup: update db comment

* Cleanup: correct db comment

* Fix: some lints

* Cleanup: lint

* Cleanup: clear nonce

* Submitter and Retries for Fraud (#1288)

* wrap each func. need to fix test

* working tests with submitter

* remove test file

* start to sql queries for crosstable dispute handling

* retries and print statements to be deleted

* undo generic retry

* remove test files

* remove other test file

* working tests

* remove print statement in executor

* implement wasse suggestions

* [goreleaser]

* fraud report branch

* gosum

* upterm

* assert->require

* log json receipt of failed txes

* receipt

* try nightly (this is a longshot)

* shorten ci runs

* shorten ci runs

* throw reverts at deployer level in addition to solidity level

* throw reverts at deployer level in addition to solidity level

* test some ideas

* remove for

* hi

* redundant

* generation fix [ci skip]

* fatal

* summit

* real chain id

* update

* uptemr

* [ci skip]

* fix host port to not be bound to hostname

* Fix: add index to avoid 'ON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint' error

* upterm

* REVERT THIS. test changing all jaeger to null

* re enable workflow

* Revert "re enable workflow"

This reverts commit f5ca330.

* Revert "REVERT THIS. test changing all jaeger to null"

This reverts commit 2320a1c.

* start to sql queries for crosstable dispute handling

* dont run upterm

* upterm

* Fix: log tx hash within submitter

* Fix: do MIN(block_number) in db query

* error instead of warn

* Delete agents/agents/guard/test.txt

* Delete agents/agents/test.txt

* no jaeger in CI

* upterm

* Add logs

* add agent status prints

* omnirpc and increase evm increaase time by 30 secs

* fix: DDDDDDDD

* no more jaeger in ci

* Retry guard constructor

* Disable upterm

* Add check for nil guard

* Enable upterm

* Enable test without pyroscope / cov

* Bump timeouts

* Add back env vars

* Add upterm

* Log err on anvil purge

* Lint

* Add time log

* Printf

* Add address to anvil log

* Remove mem limit and enable gc

* max retry to 60 secs

* maxTotalTime on guard construcotR

* swing for the fences

* agents lint

* core lint fix

* Fix: yaml lint

* Revert "Add address to anvil log"

This reverts commit 3e401d7.

* Add codecov back to workflow

* try with run instead of command

* Use command instead of run with multiline content

* clean comments

* Fix: yaml lint

* redo go.yml

* Cleanup: gh action retries

* Cleanup: remove getTestGuard() retry

* working with some noncemanager removals

* working with all noncemanager removals

* precompile tests

* up the memlimit [no_skip] [goreleaser]

* hi [goreleaser]

* fix malformed memlimit

* reintroduce pyroscope [goreleaser]

* try to fix codecov

* github

* rename coverage.txt to profile.cov

* utilize precompilation (see: golang/go#15513)

* f

* try disabing pyroscope again

* list containers at the end [revert me] [goreleaser]

* fix the issue

* minimal log collection

* go.yml

* tmp logs

* Fix: use iota+1 for contract type

* fix: anvil test and delete debugging

* Fix: address flakes in TestUpdateAgentStatusOnRemote by bumping backends

* Cleanup: add grouped stdlib imports in editorconfig

* Cleanup: add TODO

* fix: mkdir for tmp logs for tar logs

* Cleanup: use dockerutil.GetPort()

* Cleanup: isNotSummit -> isNotary

* Cleanup: more descriptive comment on GetPort() behavior

* create parent dir for tmp logs

* fix: add iota + 1 where applicable

* Fix: bump backends after updateAgentStatus()

* use different dir for getting the logs

* revert iota + 1 in agents/contract

* undo iota + 1 in agents/types

* Add logs

* sleep pass

* Revert "Add logs"

This reverts commit 8637cb6.

* Fix: verify snapshot states before bumping evm time

* Cleanup: lint

* Config: bump retries

* Config: add on_retry_command to rm docker containers

---------

Co-authored-by: Max Planck <maxplanck.crypto@gmail.com>
Co-authored-by: Trajan0x <trajan0x@users.noreply.github.com>
Co-authored-by: Max Planck <99688618+CryptoMaxPlanck@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go Pull requests that update Go code size/m
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants