-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Upgrade to fuel-core 0.18.1
and fuels-rs 0.41
#4525
Conversation
Applied latest `fuels-rs`. Fixed compilation errors.
this one supersedes #4428 |
Update CI to use 0.18.0 image
…ture/fuel-core-0.18
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.
Thanks for the PR! It is a huge help. Left couple of questions here and there but tooling changes looks good to me!
fuel-core 0.18.0
and fuels-rs 0.41
fuel-core 0.18.1
and fuels-rs 0.41
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.
Great work!
sway-core/src/semantic_analysis/ast_node/expression/intrinsic_function.rs
Show resolved
Hide resolved
BREAKING CHANGES: - `Predicate::from_code` and `Predicate::load_from` use default `ConsensusParameters` for instantiation of the predicate address. To use non-default `ConsensusParameters`, the user should use `Predicate::from_code(...).with_provider()`, that will use the provider's `ConsensusParameters`. - `Provider::new` now takes a `ConsensusParameters` argument, so we can avoid changing the API of downstream clients. - `setup_test_client` now returns `ConsensusParameters` of the client. It is less used than `setup_test_provider` so it's its API that was changed. - `produce_block` API now takes in a `start_time` as an `Option<DateTime<Utc>>` (no need for the `TimeParameters` struct) - To produce blocks, the user now needs to set `block_production` to `Trigger::Interval` (see docs) in `ChainConfig` Internal changes: - The signing of the transaction and predicate id generation requires `ChainId`(`ConsensusParameters`). - Now tokens should be transferred to the contract first, and after you can transfer them via `SMO` or another transfer. So in some tests first we need to transfer money to the contract first. - Replaced all unsafe code from `fuel-crypto` with safe analog. - On the `fuel-tx`/`fuel-core` side now, there is a difference in whether the message contains data. If data is empty, it is `MessageCoin` that acts like a `Coin`(has the same rules during execution). If the data field is not empty, then it is a retryable message(or `MessageData`). Messages like this can't be used to pay a transaction fee, and if the execution fails, the message is not consumed(you can use it again in the next transactions). More about them you can read in FuelLabs/fuel-core#946. Also, the API changed for resources and not it is `Coins` again. Because of that, some tests now require messages with empty data to be able to spend them. - Removed redundant usage of `MessageId`. Now the identifier of the message is a `Nonce`. - Removed `Output::Message`. Now you don't need to specify it in the outputs. Because of that `SMO` opcode doesn't require a message output index anymore. - The proof API is updated with a new design: FuelLabs/fuel-core#1046. If you want to prove the block at height `X` you need at least a committed `X + 1` block. Because some of opcodes were updated the examples require a new `sway`. The corresponding PR: FuelLabs/sway#4525. It creates a cycle of dependencies with this PR. Closes #829 #933 --------- Co-authored-by: iqdecay <victor@berasconsulting.com> Co-authored-by: Brandon Kite <brandonkite92@gmail.com> Co-authored-by: Ahmed Sagdati <37515857+segfault-magnet@users.noreply.github.com> Co-authored-by: Halil Beglerović <git@hal3e.io> Co-authored-by: hal3e <hal3e.git@gmail.com>
FuelLabs/fuels-rs#950 has been merged |
# Conflicts: # sway-core/src/semantic_analysis/ast_node/expression/intrinsic_function.rs
The PR is ready for the final review. It uses SDK |
Taking care of it, opened #4595 |
…ay reference examples (#4597) ## Description closes #4595. unblocks #4525. Once #4596 is fixed we can remove std declarations in each manifest file with a single patch statement in the workspace level manifest file. That will also open the way to re-enable the disabled member (reentrancy) as the example depends on sway-lib and sway-lib depends on latest released std. So without the patch table it is not useable. follow-up: #4596.
Merged the fix here, it should clear CI stuff |
## Description Waiting for: - #4525. @Dhaiwat10 was waiting for a release with the linked PR merged. @IGI-111 I had the PR ready, leaving it up to you when to merge & cut the release. Made this a major bump as we had a breaking change merged (#4574). ## Checklist - [ ] I have linked to any relevant issues. - [ ] I have commented my code, particularly in hard-to-understand areas. - [ ] I have updated the documentation where relevant (API docs, the reference, and the Sway book). - [ ] I have added tests that prove my fix is effective or that my feature works. - [ ] I have added (or requested a maintainer to add) the necessary `Breaking*` or `New Feature` labels where relevant. - [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs Code Review Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md). - [ ] I have requested a review from the relevant team or maintainers. Co-authored-by: IGI-111 <igi-111@protonmail.com>
The PR fixes breakings changes from the
fuel-core 0.18.1
andfuels-rs 0.41
.__smo
is reworked and doesn't require an output index because we removed theOutput::Message
variant.Contract::deploy
->Contract::load_from().deploy()
.ChainId
now. It breaks the API in some places. In tests, I used the default chain id, but from theforc
perspective we need to add the ability to specify it.fuels-signers
was renamed intofuels-accounts
.fuel_tx::Input
and now each variant of the enum has a named type.fuel-crypto
with safe analog.fuel-tx
/fuel-core
side now, there is a difference in whether the message contains data. If data is empty, it isMessageCoin
that acts like aCoin
(has the same rules during execution). If the data field is not empty, then it is a retryable message(orMessageData
). Messages like this can't be used to pay a transaction fee, and if the execution fails, the message is not consumed(you can use it again in the next transactions). More about them you can read in Retryable Messages fuel-core#946. Also, the API changed for resources and not it isCoins
again. Because of that, some tests now require messages with empty data to be able to spend them.MessageId
and corresponding fields. Now the identifier of the message is aNonce
.Output::Message
. Now you don't need to specify it in the outputs. Because of thatSMO
opcode doesn't require a message output index anymore.u32
in someu64
) by introducing theBlockHeight
type.nonce
in theMessage
is aBytes32
now instead ofu64
(affectedinput_message_nonce
GTF).Intrinsic::Smo
. Previouslyfuel-vm
expectedsmo(r1: receipt_and_message_ptr, r2: size_of_the_message, r3: output_index, r4: amount)
but we updated that to besmo(r1: receipt_ptr, r2: message_ptr, r3: size_of_the_message, r4: amount)
- according to the specification.input_message_msg_id
GTF.SMO
or another transfer. So in some tests first we need to transfer money to the contract first.fuels-rs
now generates a separate structure for encoder{Contract_name}Encoder
.This PR is based on the FuelLabs/fuels-rs#950 and causes cycle dependencies. The
fuels-rs
should be released first and after we can apply it.