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: Fault Testing Support #47

Closed
wants to merge 14 commits into from

Conversation

epociask
Copy link
Collaborator

@epociask epociask commented Jun 20, 2024

Fault Testing Support

Fixes Issue

Fixes #21

Changes proposed

  • Introduce configurable fault mode which allows for setting malicious return behaviors for memstore
  • Updated readme.md with fault mode info and updated soft confirmation docs
  • Updated put logic for eigenda to verify the blob length post iFFT encoding

Screenshots (Optional)

Note to reviewers

@epociask epociask closed this Jul 16, 2024
@epociask epociask reopened this Jul 31, 2024
@epociask epociask marked this pull request as ready for review July 31, 2024 16:43
@epociask epociask requested a review from bxue-l2 August 1, 2024 19:11
if err != nil {
return nil, err
}
} else {
log.Info("Using EigenDA backend")
}

if vCfg.Verify {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nix, maybe move the code block up

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good callout

ct, err := ReadCommitmentMode(r)
if err != nil {
svr.WriteBadRequest(w, invalidCommitmentMode)
return err
}

actor := ReadActor(r)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I assume we only want memstore to behave like a malicious actor. Can we not touch the code path from other storage type.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we can but that'd increase the attack surface for critical system flows that likely shouldn't ever have modifiable return behaviors (i.e, comms with mainnet). we only should ever use this feature for testing sequencer behaviors when doing QA / experimentation

Copy link
Collaborator

Choose a reason for hiding this comment

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

So can we move actor inside memstore go files, so it no longer appears in the top level codeabse

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

how would we do that when it needs to be read from the URL params?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess my concern is that we only intend memstore to have the ability to behave maliciously, then we should localize the change to the memstore itsel. Because memstore is not intended for production use in any cases. Then I feel it is relatively safe.

My understanding of of the code is that, it uses the context to determine proxy behavior. I worry it touches unnecesary part of code, making it bit harder to maintain. I worry we might accidentally inject some malicious behavior in the production path. Just my thoughts, I would invite @jianoaix to take a look.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this server for production? Is production server taking the "actor" param from http request, based on which to decide the malicious behavior which is implemented in the store?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it is but these malicious behavior patterns are only expressed within the memstore implementation which will never be used in production environments.

@@ -60,6 +61,10 @@ func (c *client) Health() error {
func (c *client) GetData(ctx context.Context, comm []byte) ([]byte, error) {
url := fmt.Sprintf("%s/get/0x%x?commitment_mode=simple", c.cfg.URL, comm)

if c.cfg.Actor != "" {
Copy link
Collaborator

Choose a reason for hiding this comment

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

One high level comment, the eigenda-proxy should be configured to work correctly most of time. Is it reasonable to make Actor a lower layer concept subject to a specific boundary.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

wdym?

G1PathFlagName = "eigenda-g1-path"
G2TauFlagName = "eigenda-g2-tau-path"
CachePathFlagName = "eigenda-cache-path"
MaxBlobLengthFlagName = "eigenda-max-blob-length"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we use "length" and "size" consistently? "length" is number of symbols from the field (32 bytes per symbol), and "size" is number of bytes

}

func LoadFaultConfig(path string) (*FaultConfig, error) {
println(fmt.Sprintf("Loading config from %s", path))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove debug info here and below?

ct, err := ReadCommitmentMode(r)
if err != nil {
svr.WriteBadRequest(w, invalidCommitmentMode)
return err
}

actor := ReadActor(r)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this server for production? Is production server taking the "actor" param from http request, based on which to decide the malicious behavior which is implemented in the store?

@epociask epociask closed this Oct 2, 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.

Fault/fraud testing
3 participants