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

feat: burn tax exemption concept (as parameter) #52

Merged
merged 22 commits into from
Feb 1, 2023

Conversation

fragwuerdig
Copy link
Collaborator

@ZaradarBH @nghuyenthevinh2000 @inon-man @edk208 - So I made this pull request showing how we could implement the whitelist as parameter in the treasury. This is by no means complete. I would need to continue on the upgrade handling and then we would need to use the actual parameter in the ante handler. But its getting late already and I need to sleep over my cold.

Would that be good for you as a starting point?

Copy link
Contributor

@ZaradarBH ZaradarBH left a comment

Choose a reason for hiding this comment

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

Looks good. You need to sync the last changes I pushed to the branch, but those should slot right in. I recon we might as well integrate it into my PR and test if altering the proto code constitutes a breaking change. By and large it shouldnt as long as we manage the "field ids" so we dont end up overlapping with legacy blocks "binary ordering", which means this might very well be a safe thing to do :)

@fragwuerdig
Copy link
Collaborator Author

@nghuyenthevinh2000 I cleaned up my originally proposed parameter mess.

@StrathCole
Copy link
Collaborator

Just one thing I would like to throw in is that I am not sure if spending too much of the work on this is good at the moment. If it is for "general improvement of parameters", yes. If it's specifically for whitelisting, I would suggest not to. Because it's not even sure that any whitelisting (and what form of) will be voted on (or even pass) by governance.
Just my opinion.

@fragwuerdig
Copy link
Collaborator Author

Just one thing I would like to throw in is that I am not sure if spending too much of the work on this is good at the moment. If it is for "general improvement of parameters", yes. If it's specifically for whitelisting, I would suggest not to. Because it's not even sure that any whitelisting (and what form of) will be voted on (or even pass) by governance. Just my opinion.

rofl - that's exactly what I said before in the review section: here

@StrathCole
Copy link
Collaborator

rofl - that's exactly what I said before in the review section: here

Thanks, didn't see that.

Base automatically changed from whitelist-concept to main January 20, 2023 14:10
@ZaradarBH
Copy link
Contributor

I think in general it makes sense to prepare the code for future change via a "parameter stub" simply because its not a lot of work. So I think in the context of this PR we should just complete that work, resolve the conflicts and get the PR merged :)

@ZaradarBH ZaradarBH added documentation Improvements or additions to documentation out of scope work that is unapproved by the community, but still essential for the L1 team enhancement New feature or request and removed documentation Improvements or additions to documentation labels Jan 20, 2023
@ZaradarBH ZaradarBH added this to the v1.0.6 milestone Jan 20, 2023
@ZaradarBH
Copy link
Contributor

ZaradarBH commented Jan 25, 2023

Great work @nghuyenthevinh2000 & @fragwuerdig :)

@nghuyenthevinh2000
Copy link
Contributor

@fragwuerdig @JoowonYun
I would merge this now, do you have any further comments?

@ZaradarBH
Copy link
Contributor

The liveness test seems to keep failing on this PR :) @nghuyenthevinh2000 can you look into what might be breaking this?

Copy link

@JoowonYun JoowonYun left a comment

Choose a reason for hiding this comment

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

SetWhitelistAddressProposal and RemoveWhitelistAddressProposal must be added to RegisterLegacyAminoCodec and RegisterInterfaces of the treasury module.

@nghuyenthevinh2000
Copy link
Contributor

I have run over two test:

  1. Test Submit proposal to add whitelist address, it returns correct addresses here

Screenshot 2023-01-31 at 18 32 08

  1. Upgrade test to make sure that Binance whitelist addresses are included

Screenshot 2023-01-31 at 18 39 51

Steps to reproduce

  1. run bash scripts/whitelist-test.sh
  2. run bash scripts/upgrade-test.sh

Copy link
Contributor

@ZaradarBH ZaradarBH left a comment

Choose a reason for hiding this comment

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

Great work buddy <3

Copy link

@JoowonYun JoowonYun left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@ZaradarBH ZaradarBH left a comment

Choose a reason for hiding this comment

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

I did some extended testing because quiet frankly this liveness-test failing was bugging me. If I run it locally and build the images via "make clean localnet-start" docker will build the images however when the containers are started they all instantly crash with this stack trace:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1730f7a]

goroutine 1 [running]:
github.com/cosmos/cosmos-sdk/x/gov.AppModuleBasic.RegisterRESTRoutes({{_, }, {, _, }}, {{0x0, 0x0, 0x0}, {0x2ef4308, 0xc000225a40}, ...}, ...)
github.com/cosmos/[email protected]/x/gov/module.go:79 +0x13a
github.com/cosmos/cosmos-sdk/types/module.BasicManager.RegisterRESTRoutes(...)
github.com/cosmos/[email protected]/types/module/module.go:114
github.com/terra-money/core/app.(*TerraApp).RegisterAPIRoutes(0x2edd090?, 0xc0010f2000, {0x1, 0x0, 0x0, {0xc0004dafc0, 0x12}, 0x3e8, 0xa, 0x0, ...})
github.com/terra-money/core/app/app.go:813 +0x49d
github.com/cosmos/cosmos-sdk/server.startInProcess(
, {{0x0, 0x0, 0x0}, {0x2ef4308, 0xc000225a40}, {0x0, 0x0}, {0x2edd090, 0xc001204220}, ...}, ...)
github.com/cosmos/[email protected]/server/start.go:325 +0xc36
github.com/cosmos/cosmos-sdk/server.StartCmd.func2(0xc001250900?, {0xc0004e6bc0?, 0x0?, 0x4?})
github.com/cosmos/[email protected]/server/start.go:129 +0x169
github.com/spf13/cobra.(*Command).execute(0xc001250900, {0xc0004e6b80, 0x4, 0x4})
github.com/spf13/[email protected]/command.go:916 +0x862
github.com/spf13/cobra.(*Command).ExecuteC(0xc001146c00)
github.com/spf13/[email protected]/command.go:1044 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
github.com/spf13/[email protected]/command.go:968
github.com/spf13/cobra.(*Command).ExecuteContext(...)
github.com/spf13/[email protected]/command.go:961
github.com/cosmos/cosmos-sdk/server/cmd.Execute(0x0?, {0xc00116de30, 0x7})
github.com/cosmos/[email protected]/server/cmd/execute.go:36 +0x1eb
main.main()
github.com/terra-money/core/cmd/terrad/main.go:15 +0x2c

My assumption is that something in the PR is causing the start command to blow up which is why the liveness test ultimately fails.

@nghuyenthevinh2000 if you could look into this that would be great. I will be available tomorrow between 0900 and 1200 CET to help you debug if you need assistance with the docker stuff :)

@nghuyenthevinh2000
Copy link
Contributor

nghuyenthevinh2000 commented Jan 31, 2023

I did some extended testing because quiet frankly this liveness-test failing was bugging me. If I run it locally and build the images via "make clean localnet-start" docker will build the images however when the containers are started they all instantly crash with this stack trace:

panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1730f7a]

goroutine 1 [running]: github.com/cosmos/cosmos-sdk/x/gov.AppModuleBasic.RegisterRESTRoutes({{_, }, {, _, }}, {{0x0, 0x0, 0x0}, {0x2ef4308, 0xc000225a40}, ...}, ...) github.com/cosmos/[email protected]/x/gov/module.go:79 +0x13a github.com/cosmos/cosmos-sdk/types/module.BasicManager.RegisterRESTRoutes(...) github.com/cosmos/[email protected]/types/module/module.go:114 github.com/terra-money/core/app.(*TerraApp).RegisterAPIRoutes(0x2edd090?, 0xc0010f2000, {0x1, 0x0, 0x0, {0xc0004dafc0, 0x12}, 0x3e8, 0xa, 0x0, ...}) github.com/terra-money/core/app/app.go:813 +0x49d github.com/cosmos/cosmos-sdk/server.startInProcess(, {{0x0, 0x0, 0x0}, {0x2ef4308, 0xc000225a40}, {0x0, 0x0}, {0x2edd090, 0xc001204220}, ...}, ...) github.com/cosmos/[email protected]/server/start.go:325 +0xc36 github.com/cosmos/cosmos-sdk/server.StartCmd.func2(0xc001250900?, {0xc0004e6bc0?, 0x0?, 0x4?}) github.com/cosmos/[email protected]/server/start.go:129 +0x169 github.com/spf13/cobra.(*Command).execute(0xc001250900, {0xc0004e6b80, 0x4, 0x4}) github.com/spf13/[email protected]/command.go:916 +0x862 github.com/spf13/cobra.(*Command).ExecuteC(0xc001146c00) github.com/spf13/[email protected]/command.go:1044 +0x3bd github.com/spf13/cobra.(*Command).Execute(...) github.com/spf13/[email protected]/command.go:968 github.com/spf13/cobra.(*Command).ExecuteContext(...) github.com/spf13/[email protected]/command.go:961 github.com/cosmos/cosmos-sdk/server/cmd.Execute(0x0?, {0xc00116de30, 0x7}) github.com/cosmos/[email protected]/server/cmd/execute.go:36 +0x1eb main.main() github.com/terra-money/core/cmd/terrad/main.go:15 +0x2c

My assumption is that something in the PR is causing the start command to blow up which is why the liveness test ultimately fails.

@nghuyenthevinh2000 if you could look into this that would be great. I will be available tomorrow between 0900 and 1200 CET to help you debug if you need assistance with the docker stuff :)

thanks @ZaradarBH for further debugging

it is due to me registering rest proposal handler as nil. I have changed it to an implementation

After fixing it, querying whitelist through rest api
Screenshot 2023-02-01 at 00 00 46
is working here

@nghuyenthevinh2000
Copy link
Contributor

Quẩy_meme

Ey, it passes all

@fragwuerdig
Copy link
Collaborator Author

fragwuerdig commented Jan 31, 2023

Ey, it passes all

:D good job!

Copy link
Contributor

@ZaradarBH ZaradarBH left a comment

Choose a reason for hiding this comment

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

image

@ZaradarBH ZaradarBH merged commit aad3987 into main Feb 1, 2023
@nghuyenthevinh2000 nghuyenthevinh2000 self-assigned this Feb 3, 2023
@inon-man inon-man deleted the whitelist-concept-parameter branch February 13, 2023 15:58
@inon-man inon-man changed the title Whitelist concept (as parameter) Burn tax exemption concept (as parameter) Feb 18, 2023
@inon-man inon-man changed the title Burn tax exemption concept (as parameter) feat: burn tax exemption concept (as parameter) Feb 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request out of scope work that is unapproved by the community, but still essential for the L1 team
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants