-
Notifications
You must be signed in to change notification settings - Fork 501
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
internal/integration: update the soroban tests for auth next support #4759
internal/integration: update the soroban tests for auth next support #4759
Conversation
contract fn invoke tests are failing at present, much of lower stack is changing atm, env/sdk, need to update the contract test fixtures here to ref the latest rs-soroban-sdk version and also pull the new soroban core with same rs-soroban-env for integration tests to run. |
@@ -0,0 +1,15 @@ | |||
### Contract test fixture source code | |||
#### anytime contracct code changes, follow these steps to rebuild the test wasm fixtures: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be automated using go generate
and go embed
. Checkout https://github.com/stellar/starbridge/pull/102/files#diff-e27b4787f7b159227c12040f2ed88c1010e737e596b05418831f0b42c4d8243e (specifically, gen.go ). You can add a go file in this directory with the following contents:
package contracts
import _ "embed"
//go:generate sh -c "cargo build --target wasm32-unknown-unknown --release"
//go:embed target/wasm32-unknown-unknown/release/add_u64.wasm
var AddU64Wasm []byte
This way all the contract code will be built via the go generate command (which we already run to generate xdr in the repo).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that will work because AFAIC you cannot embed files in parent directories (and the current directory for go:embed
is the source file's directory)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the target folder containing the wasm is a child directory of the contracts directory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tamirms @2opremio , do we want to start pulling this type of soroban dependency into horizon, the build environment will need to have rust toolchain, we'll need to track down build pipelines on horizon, there's jenkins pipeline builder, and quickstart have builders that would need to update.
I think in the short term of release prep, I could look into something like a dockerfile, which dev can manually run to automate the steps to some degree, does the rust toolchain and cargo builds internally and copy the wasm's to the /testdata/ destination.
can do more enhanced approach such as gogenerate and change the external builder integrations if needed as follow-on tech debt?
Related: #4760 We should probably incorporate a test making use of auth-next |
…agging and recompiled contracts
@2opremio , as part of footprint processing in sac_test.go, add_footprint(), it's submitting preflight to core's endpoint first and getting errors:
should that be happening still or has preflight check been changed to use a new endpoint on rpc instead? |
@sreuland uhm, I am not sure what’s broken. I can take a look today. However, note that AFAIU Core’s simulate transaction endpoint is going away, so we will need to replace it with soroban rpc at some point. |
@sreuland the error is coming from changes in the token contract (which the tests aren't yet accounting for). See stellar/rs-soroban-env@fc611e5#diff-762cdd179f5c2d24d87ffe8aec8070d12ecdfaf53af56c19d07dfdcaf77bdc29 For instance, fn mint(
e: &Host,
admin: Signature,
nonce: i128,
to: Identifier,
amount: i128,
) -> Result<(), HostError>; to fn mint(e: &Host, admin: Address, to: Address, amount: i128) -> Result<(), HostError>; Note that it now has 3 arguments. |
I started converting the arguments but I am not sure how to create an |
62727b8
to
4e51ae9
Compare
ok, that helps me narrow focus, I'll look at your TODO and proceed from there, thanks! |
@2opremio @tamirms , tests are back in green. maybe we should merge at this point as #4757 criteria are met. I can capture the request for automation of wasm compilation that was raised here as follow on ticket. |
Sure! |
PR Checklist
PR Structure
otherwise).
services/friendbot
, orall
ordoc
if the changes are broad or impact manypackages.
Thoroughness
.md
files, etc... affected by this change). Take a look in the
docs
folder for a given service,like this one.
Release planning
needed with deprecations, added features, breaking changes, and DB schema changes.
semver, or if it's mainly a patch change. The PR is targeted at the next
release branch if it's not a patch change.
What
recompiled the wasms with latest upcoming version of rs-soroban-sdk which includes the auth next.
moved the contract source code for test fixtures into integration tests as well for full control.
Why
the soroban contract tests won't work until they are recompiled with wasm that is compliant with latest that core expects for auth next invocations.
Closes: #4757
Known limitations