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

OP: refactor: consolidate IS_ENABLED into CONFIG #21

Open
maurolacy opened this issue Jul 31, 2024 · 2 comments
Open

OP: refactor: consolidate IS_ENABLED into CONFIG #21

maurolacy opened this issue Jul 31, 2024 · 2 comments

Comments

@maurolacy
Copy link
Collaborator

@bap2pecs cloned issue babylonchain/babylon-contract#194 on 2024-06-27:

when I was querying the contract to see its states I need to run both


$ QUERY='{"config":{}}'                                                             [13:41:57]

babylond query wasm contract-state smart $CONTRACT_ADDR "$QUERY" --chain-id euphrates-0.2.0 --node https://rpc-euphrates.devnet.babylonchain.io -o json

{"data":{"consumer_id":"op-stack-l2-12345","activated_height":1022293}}



and


$ QUERY='{"is_enabled":{}}'                                                         [13:42:05]

babylond query wasm contract-state smart $CONTRACT_ADDR "$QUERY" --chain-id euphrates-0.2.0 --node https://rpc-euphrates.devnet.babylonchain.io -o json

{"data":true}

then I realized that we should:

  • merge the isenabeld state into config

    • update ExecuteMsg::SetEnabled accordingly
  • remove QueryMsg::IsEnabled

this will be cleaner

@maurolacy
Copy link
Collaborator Author

@bap2pecs commented on 2024-06-28:

discussed w @parketh offline.

i think the current setup is good in that there is seperation between immutable values (config) and mutable values (is_enabled)

the immutable values would normally be called sth like ‘ChainInfo’ and then the configs can be ‘ChainConfig’

let's keep it for now

@maurolacy
Copy link
Collaborator Author

@bap2pecs commented on 2024-07-08:

thinking about it more. i think having two state vars is probably unnecessary. for example, in itest/opstackl2/devnet-data/devnetL1.json, there are some fields immutable but some seems mutable but they don't use two separate files.

i also remember for CDK deployment parameters, some are immutable but some change be changed in the CDK contract later

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

No branches or pull requests

1 participant