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

fix(ante): use native ante handler and check permissions for vesting URLs #197

Conversation

danwt
Copy link
Contributor

@danwt danwt commented Apr 26, 2024

Description

see also #200


Closes #193

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow-up issues.

PR review checkboxes:

I have...

  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Targeted PR against the correct branch
  • included the correct type prefix in the PR title
  • Linked to the GitHub issue with discussion and accepted design
  • Targets only one GitHub issue
  • Wrote unit and integration tests
  • Wrote relevant migration scripts if necessary
  • All CI checks have passed
  • Added relevant godoc comments
  • Updated the scripts for local run, e.g genesis_config_commands.sh if the PR changes parameters
  • Add an issue in the e2e-tests repo if necessary

SDK Checklist

  • Import/Export Genesis
  • Registered Invariants
  • Registered Events
  • Updated openapi.yaml
  • No usage of go map
  • No usage of time.Now()
  • Used fixed point arithmetic and not float arithmetic
  • Avoid panicking in Begin/End block as much as possible
  • No unexpected math Overflow
  • Used sendCoin and not SendCoins
  • Out-of-block compute is bounded
  • No serialized ID at the end of store keys
  • UInt to byte conversion should use BigEndian

Full security checklist here

----;

For Reviewer:

  • Confirmed the correct type prefix in the PR title
  • Reviewers assigned
  • Confirmed all author checklist items have been addressed

---;

After reviewer approval:

  • In case the PR targets the main branch, PR should not be squash merge in order to keep meaningful git history.
  • In case the PR targets a release branch, PR must be rebased.

ethante.NewEthSigVerificationDecorator(options.EvmKeeper),
ethante.NewEthAccountVerificationDecorator(options.AccountKeeper, options.EvmKeeper),
ethante.NewCanTransferDecorator(options.EvmKeeper),
ethante.NewVirtualFrontierContractDecorator(options.EvmKeeper), // prevent transfer to virtual frontier contract
Copy link
Collaborator

Choose a reason for hiding this comment

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

NewVirtualFrontierContractDecorator can be removed from rollapp-evm
vfc is not wired in app.go

Copy link
Contributor Author

@danwt danwt Apr 26, 2024

Choose a reason for hiding this comment

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

ok, are you sure?
just FYI though
it's here as well https://github.com/dymensionxyz/ethermint/blob/b0f9c1b0a37f6fd06d9dc61745ec1e9561461a29/app/ante/handler_options.go#L78
which is what we would depend on if we didn't implement our own

return sdk.ChainAnteDecorators(
cosmosDecorators(
options,
func(c *codectypes.Any) bool {
Copy link
Collaborator

Choose a reason for hiding this comment

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

it's wrong, it supposed to be return false.
anyway I think it's more clear to leave it nil, and have the default (which is return false)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

but this is the legacy one
so we dont want to reject, because the legacy one HAS the extension

/ethermint.types.v1.ExtensionOptionsWeb3Tx

https://github.com/evmos/ethermint/blob/382a6aec8111a4e2e3e9a7c41438475f6920134c/app/ante/eip712.go#L58-L59

Copy link
Collaborator

Choose a reason for hiding this comment

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

it should be added here
ExtensionOptionChecker: evmostypes.HasDynamicFeeExtensionOption,

@danwt danwt requested a review from mtsitrin April 26, 2024 15:23
@danwt
Copy link
Contributor Author

danwt commented Apr 29, 2024

we will do this on 2.1x instead
#216

@danwt danwt closed this Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use native ante handler and permissioned vesting
2 participants