Skip to content

Conversation

@redpanda-f
Copy link

Enable 2K mode to work well with foc-localnet-v1-rc

@redpanda-f redpanda-f requested a review from a team as a code owner January 2, 2026 10:21
@snadrus
Copy link
Contributor

snadrus commented Jan 2, 2026

This is not going to be accepted without significant changes. Many settings should be a layer you define outside the code. Is there a reason the current pdp configurability is insufficient (as we have been using them to test)?

@magik6k
Copy link
Collaborator

magik6k commented Jan 3, 2026

Env vars in pdp/contract/addresses.go are fine imho, but changes to default config are very much not, best way to do that is to define and insert a default layer for 'fws' into the database through db schema migration

Copy link
Contributor

@LexLuthr LexLuthr left a comment

Choose a reason for hiding this comment

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

All contract ENVs should handle debug along with 2k.
Changes to config is not an option. Please check how Curio's devnet is run under docker directory.

return common.HexToAddress(MultiCallAddressCalibnet), nil
case build.BuildMainnet:
return common.HexToAddress(MultiCallAddressMainnet), nil
case build.Build2k:
Copy link
Contributor

Choose a reason for hiding this comment

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

We also need this for debug build.

}
case build.Build2k:
// For 2k, require environment variables
payAddr := os.Getenv("FOC_CONTRACT_PAY")
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we have another FOC variable here outside of payment package?

panic("FOC_CONTRACT_PAY must be a valid hex address")
}

pdpVerifierAddr := os.Getenv("FOC_PDP_VERIFIER_PROXY")
Copy link
Contributor

Choose a reason for hiding this comment

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

Curio doesn't care PROXY vs Main. Just use PDP_VERIFIER. No FOC either.

}
fmt.Fprintf(os.Stderr, "[2K] FOC_CONTRACT_FWSS=%s\n", fwssAddr)

simpleAddr := os.Getenv("FOC_CONTRACT_SIMPLE")
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not FOC. Please stop adding FOC everywhere.


fmt.Fprintf(os.Stderr, "[2K] FOC_PDP_VERIFIER_PROXY=%s\n", pdpVerifierAddr)

fwssAddr := os.Getenv("FOC_CONTRACT_FWSS")
Copy link
Contributor

Choose a reason for hiding this comment

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

Not FOC. Just FWSS is enough.

if !common.IsHexAddress(usdfc) {
return common.Address{}, xerrors.Errorf("FOC_CONTRACT_USDFC must be a valid hex address")
}
fmt.Fprintf(os.Stderr, "[2K] FOC_CONTRACT_USDFC=%s\n", usdfc)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use logging and don't print on StdErr.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is not really used anymore. Use SDK.

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.

4 participants