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

[NONEVM-1091] - Refactor/Setup CR init and cfg and codec init #991

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

ilija42
Copy link
Contributor

@ilija42 ilija42 commented Dec 23, 2024

Description

  1. Refactor CR init and codec init to be more like EVM CR
  2. CR now discerns codec input and output modifiers
  3. Rewrite cfg to match the new development
  4. Rewrite cfg validation and unmarshal to allow IDL to be passed in both as a string or structured
  5. Align naming for all type naming vars for CR to be genericName<>chainSpecificName

@ilija42 ilija42 marked this pull request as ready for review December 24, 2024 17:55
@ilija42 ilija42 requested a review from a team as a code owner December 24, 2024 17:55
@ilija42 ilija42 changed the title Refactor CR init and cfg Refactor/Setup CR init and cfg and codec init Dec 24, 2024
@cl-sonarqube-production
Copy link

Quality Gate failed Quality Gate failed

Failed conditions
72.5% Coverage on New Code (required ≥ 75%)

See analysis details on SonarQube

Comment on lines 312 to +313
// This is necessary because AddressModifier cannot be serialized and must be applied at runtime.
func injectAddressModifier(outputModifications codeccommon.ModifiersConfig) {
func injectAddressModifier(inputModifications, outputModifications commoncodec.ModifiersConfig) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you elaborate on this a little bit more? Why would someone use commoncodec.AddressBytesToStringModifierConfig instead of codec.SolanaAddressModifier{}?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because this AddressBytesToStringModifierConfig is the actual serializeable modifier config, the actual chain specific impl. which is a function and therefore cannot be serialized is injected during CR startup

@ilija42 ilija42 requested a review from silaslenihan December 24, 2024 21:37
@ilija42 ilija42 changed the title Refactor/Setup CR init and cfg and codec init [NONEVM-1060] - Refactor/Setup CR init and cfg and codec init Dec 24, 2024
@ilija42 ilija42 changed the title [NONEVM-1060] - Refactor/Setup CR init and cfg and codec init [NONEVM-1091] - Refactor/Setup CR init and cfg and codec init Dec 24, 2024
ReadType ReadType `json:"readType,omitempty"`
InputModifications commoncodec.ModifiersConfig `json:"inputModifications,omitempty"`
OutputModifications commoncodec.ModifiersConfig `json:"outputModifications,omitempty"`
RPCOpts *RPCOpts `json:"rpcOpts,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Are the RPCOpts necessary anymore? We are explicitly using finalized commitment and encoding will probably always be base64. The only remaining option is for data slices. Do we use that or are we expecting to use that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Idk, I haven't looked into this yet, just kept it because it was already there

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it can most likely be removed

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.

3 participants