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

test: rest of unit tests for each module #323

Merged
merged 43 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
e88abba
bring changes from main to release (#244)
facundomedica Aug 1, 2024
8568d56
fix: release tag in header (#246) (#247)
github-actions[bot] Aug 1, 2024
294aaf2
playground tbr minting (#248) (#250)
github-actions[bot] Aug 2, 2024
201858a
stake update expiration getter (#249) (#251)
github-actions[bot] Aug 2, 2024
09f45c7
feat: Any rpc (#254) (#257)
github-actions[bot] Aug 6, 2024
48750f3
fix: marshal empty vote extensions (#256) (#258)
github-actions[bot] Aug 6, 2024
31bd6d9
chore: add upgrade handler v2 + reenable ante for MsgCreateValidator …
github-actions[bot] Aug 6, 2024
7d297fa
chore: modify team address during v0.2.0 upgrade (#261) (#262)
github-actions[bot] Aug 7, 2024
3fc02dd
fix: correct preblocker (#264) (#266)
github-actions[bot] Aug 9, 2024
dc33f39
fix: Rollback upgrade to relaunch (#267) (#268)
github-actions[bot] Aug 9, 2024
901b63c
new token bridge contract (#269) (#270)
github-actions[bot] Aug 9, 2024
b63623b
fix: Reporter daemon dynamic chainid (#272) (#274)
github-actions[bot] Aug 9, 2024
f412a11
hardcoded chain id (#275) (#276)
github-actions[bot] Aug 9, 2024
b53fe10
feat: re add MsgCreateValidator check in ante (#271) (#277)
github-actions[bot] Aug 12, 2024
f387e98
chore: ADRs and white paper updates (#278) (#279)
github-actions[bot] Aug 13, 2024
12c3720
test: ante.go / extend_vote.go / proposal_handler.go tests (#285) (#…
github-actions[bot] Aug 16, 2024
dad341c
add globalfee (#283) (#287)
github-actions[bot] Aug 16, 2024
4ab2e8e
chore: add claim deposit tip to ADR 2001- trb bridge structure (#288)…
github-actions[bot] Aug 21, 2024
b67ee60
Add selector tips query getter (#290) (#291)
github-actions[bot] Aug 21, 2024
0c3ec20
update TellorLayer - Tech.pdf (#293) (#294)
github-actions[bot] Aug 22, 2024
f1209c8
Update version and set min fee (#295) (#296)
github-actions[bot] Aug 22, 2024
dbab110
Add module to upgrade handler (#297) (#298)
github-actions[bot] Aug 22, 2024
41bf924
test: extend_vote.go (#300) (#301)
github-actions[bot] Aug 23, 2024
9febaa5
fix: remove unnecessary SetParams in upgrade handler (#299) (#302)
github-actions[bot] Aug 26, 2024
1587525
fix!: Upgrade SDK and IAVL (#307) (#308)
github-actions[bot] Aug 28, 2024
f4ac133
test: rest of extend_vote.go tests (#309)
danflo27 Sep 3, 2024
8dad4c6
test: rest of extend_vote.go tests (#309) (#310)
github-actions[bot] Sep 3, 2024
df096a5
chore: Add tips for token bridge deposits (#304)
tkernell Sep 3, 2024
a1b1a97
registry coverage and linting
danflo27 Sep 3, 2024
55caadd
Chore: Fix Merge Conflicts from TokenBridge tips PR (#311)
tkernell Sep 3, 2024
08b41f3
Chore: Delete PNG for merge (#313)
tkernell Sep 3, 2024
e153ad7
Merge branch 'release/v0.x' into main
brendaloya Sep 3, 2024
843cbb4
Update client.go (#315)
tkernell Sep 3, 2024
e30ebe0
added pic for adr2001 (#316)
brendaloya Sep 4, 2024
cdc0e4f
Chore: Claim Deposits in Batches (#318)
tkernell Sep 4, 2024
3de930a
upgrade name change (#320)
tkernell Sep 5, 2024
b9f9c1f
linting
danflo27 Sep 5, 2024
e0a1bda
.
danflo27 Sep 5, 2024
05ab68b
Merge branch 'daemon-reporter', remote-tracking branch 'origin' into …
danflo27 Sep 5, 2024
59457e8
fix tests from merge
danflo27 Sep 5, 2024
0255a12
oracle/token_bridge_deposit.go tests
danflo27 Sep 5, 2024
de5703e
reporter module tests
danflo27 Sep 5, 2024
b1d9e00
bridge module tests
danflo27 Sep 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ release/
.hypothesis
evm/artifacts
evm/cache
evm/.deploys/
evm/contracts/*/artifacts
evm/node_modules
evm/package-lock.json
prod-sim/deskAlice
Expand Down
13 changes: 7 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,6 @@ proto-update-deps:
mock-clean-all:
@find . -type f -name "*.go" -path "*/mocks/*" -exec rm -f {} +

mock-gen-app:
@go run github.com/vektra/mockery/v2 --name=StakingKeeper --dir=$(CURDIR)/app/ --recursive --output=./app/mocks
@go run github.com/vektra/mockery/v2 --name=BridgeKeeper --dir=$(CURDIR)/app/ --recursive --output=./app/mocks
@go run github.com/vektra/mockery/v2 --name=OracleKeeper --dir=$(CURDIR)/app/ --recursive --output=./app/mocks


mock-gen-bridge:
@go run github.com/vektra/mockery/v2 --name=StakingKeeper --dir=$(CURDIR)/x/bridge/types --recursive --output=./x/bridge/mocks
@go run github.com/vektra/mockery/v2 --name=AccountKeeper --dir=$(CURDIR)/x/bridge/types --recursive --output=./x/bridge/mocks
Expand Down Expand Up @@ -180,6 +174,13 @@ mock-gen-daemon:
@go run github.com/vektra/mockery/v2 --name=QueryClient --dir=$(CURDIR)/testutil/grpc --recursive --output=$(CURDIR)/daemons/mocks
@go run github.com/vektra/mockery/v2 --name=RequestHandler --dir=$(CURDIR)/daemons/types --recursive --output=$(CURDIR)/daemons/mocks
@go run github.com/vektra/mockery/v2 --name=TimeProvider --dir=$(CURDIR)/lib/time --recursive --output=$(CURDIR)/daemons/mocks

mock-gen-app:
@go run github.com/vektra/mockery/v2 --name=StakingKeeper --dir=$(CURDIR)/app/ --recursive --output=./app/mocks
@go run github.com/vektra/mockery/v2 --name=BridgeKeeper --dir=$(CURDIR)/app/ --recursive --output=./app/mocks
@go run github.com/vektra/mockery/v2 --name=OracleKeeper --dir=$(CURDIR)/app/ --recursive --output=./app/mocks
@go run github.com/vektra/mockery/v2 --name=Keyring --dir=$(GOPATH)/pkg/mod/github.com/cosmos/cosmos-sdk@$(COSMOS_VERSION)/crypto/keyring --recursive --output=./app/mocks

mock-gen:
$(MAKE) mock-gen-bridge
$(MAKE) mock-gen-dispute
Expand Down
7 changes: 5 additions & 2 deletions adr/adr2001 - trb bridge structure.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# ADR 2001: TRB bridge structure
## Authors

@themandalore
@themandalore
@brendaloya
@tkernell

## Changelog

Expand All @@ -11,6 +12,7 @@
- 2024-08-12: spelling
- 2024-08-20: added the claim deposit tip

- 2024-08-29: add separate withdraw and deposit limits and minimum deposit amount
## Context

Tellor Tributes (TRB) is the tellor token. It exists on Ethereum and cannot be changed. It mints ~4k to the team each month and ~4k to the oracle contract for time based inflationary rewards (tbr). When starting Layer we will launch a bridging contract where parties can deposit TRB to Layer. Layer will utilize reporters then to report deposit events to itself. When the deposit is made it will be assigned a deposit ID and an event will be kicked off. All reporters will report for that event for a 1 hour window (this is allowed so that reporters are able to wait a certain amount of blocks before reporting so that the state of Ethereum has reached a high level of finality) and then we will optimistically use the report in our system, ensuring that the report is at least 12 hours old before the tokens are minted on Layer. Once the value is 12 hours old anyone can mint the tokens on Layer for the specified deposit ID.
Expand All @@ -20,10 +22,11 @@ Claiming the deposit on Layer costs gas. A party bridging TRB to Layer for the f
![ ADR2001](./graphics/adr2001.png)


As an additional security measure, the bridge contract will not allow more than 20% of the total supply on Layer to be bridged within a 12 hour period (the function will be locked). This will be to ensure that someone does not bridge over a very large amount to stake/grief the network, manipulate votes, or grief the system via disputes without proper time to analyze the situation. For the reverse direction, parties will burn TRB on Layer, the validators will then attest that it happened and then the bridge contract on Ethereum can use the tellor data as any other user, but this time reading burn events. A 20% withdraw limit is also used in this direction and the bridge contract will also use the data optimistically (12 hours old) to further reduce attack vectors.
As an additional security measure, the bridge contract will not allow more than 20% of the total supply on Layer to be bridged to Layer within a 12 hour period (the function will be locked). This will be to ensure that someone does not bridge over a very large amount to stake/grief the network, manipulate votes, or grief the system via disputes without proper time to analyze the situation. The bridge contract also enforces a minimum deposit amount of 0.1 TRB to prevent spamming the bridge with small deposits. For the reverse direction, parties will burn TRB on Layer, the validators will then attest that it happened and then the bridge contract on Ethereum can use the tellor data as any other user, but this time reading burn events. A 5% withdraw limit per 12 hours is used in this direction and the bridge contract will also use the data optimistically (12 hours old) to further reduce attack vectors. The 5% withdraw limit mitigates the worst case scenario where a supermajority of the reporter set is compromised, allowing time to react and coordinate a social fork.

The cycle list helps keep the network alive by providing a list of data requests that reporters can support to receive time-based rewards(inflationary rewards) when there are no tips available to claim. Each data request on the cycle list rotates over time so that each request gets pushed on chain on a regular basis. The bridge deposit data request will not appear in the "next request" of the cycle list, however reporters will be allowed to report for it and claim time based rewards for it. Time based rewards will be split between the data request on the cycle list and the bridged deposit request. Parties can also use the tip functionality to incentivize faster updates for deposits.


![ ADR1003](./graphics/adr1003.png)

## Alternative Approaches
Expand Down
Binary file modified adr/graphics/adr2001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading