| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
Implement dynamic storage opcodes in the compiler (#7595) ## Description This PR is a step in implementing #7560. It adds compiler support for [dynamic storage opcodes](https://github.com/FuelLabs/fuel-specs/pull/640) by: - supporting all opcodes in `asm` blocks. - adding IR instructions for all opcodes. Note that the `FuelVmInstruction::StatePreload` IR instruction returns zero if the slot is not used, but also if it is used and contains zero-sized content. The reason is that zero-sized storage types, like, e.g. `StorageVec`, have special semantics in the storage API and the `storage_api` does not write zero-sized types into storage, nor reads them. Modeling the IR instruction this way preserves this semantics and allows for more efficient implementation that is actually needed in the API. (Returning both the length and the existence information would require a stack allocation and more gas expensive compilation for something that is actually not used.) This API semantics might be changed to support zero-sized types like any other types. This would be a separate breaking change and a part of [Configurable and composable storage RFC](https://github.com/FuelLabs/sway-rfcs/pull/40). Meanwhile, if a distinction between unused and zero-sized used slot is needed while preloading, it can be achieved by using the `SPLD` opcode in `asm` block. ## Checklist - [x] I have linked to any relevant issues. - [x] 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). - [ ] If my change requires substantial documentation changes, I have [requested support from the DevRel team](https://github.com/FuelLabs/devrel-requests/issues/new/choose) - [x] 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. - [x] 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). - [x] I have requested a review from the relevant team or maintainers. | 5 个月前 | |
Add event support via `#[event]` and `#[indexed]` attributes (#7158) This PR adds two new attributes: `#[event]` and `#[indexed]`. The `#[event]` attribute marks a struct or enum as an event that can be emitted by a contract. The `#[indexed]` attribute can be applied to fields within structs that are attributed with `#[event]`. This is particularly useful for event structs, allowing for efficient filtering and searching of emitted events based on the values of these fields. When using this attribute, the indexed fields must be applied sequentially to the initial set of fields in a struct. This attribute can only be applied to fields whose type is an exact size ABI type. The exact size ABI types include: - `bool` - `u8`, `u16`, `u32`, `u64`, `u256` - `numeric` - `b256` - `str[N]` - Tuples containing only exact size types - Structs containing only exact size types - Arrays of exact size types with a literal length - Type aliases to exact size types Additionally it causes the event types to be included in the JSON ABI representation for the contract and emits an `offset` for indexed fields. ```sway #[event] struct MyEventStruct { #[indexed] id: u64, sender: Identity, } ``` | 10 个月前 | |
chore: bumpt rust version to 1.90 (#7427) ## Description Bumping the rust version to 1.90 and fixing the clippy lints along the way | 11 个月前 | |
chore: bumpt rust version to 1.90 (#7427) ## Description Bumping the rust version to 1.90 and fixing the clippy lints along the way | 11 个月前 | |
Fix runtime memory layout of string arrays (#7517) ## Description This PR remove the padding automatically added to string arrays that was needed for encoding v0. As we approach making encoding v1 the default, we can start to deprecate and kill everything needed for v0. ## Checklist - [ ] I have linked to any relevant issues. - [x] 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). - [ ] If my change requires substantial documentation changes, I have [requested support from the DevRel team](https://github.com/FuelLabs/devrel-requests/issues/new/choose) - [x] 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. - [x] 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). - [x] I have requested a review from the relevant team or maintainers. --------- Co-authored-by: Igor Rončević <ironcev@hotmail.com> | 7 个月前 | |
Revert feat: introduce fuel-telemetry macros (#7295) (#7451) ## Description Ran git revert to revert telemetry changes causing #7449 #7450 | 11 个月前 | |
chore: bumpt rust version to 1.90 (#7427) ## Description Bumping the rust version to 1.90 and fixing the clippy lints along the way | 11 个月前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 5 个月前 | ||
| 10 个月前 | ||
| 11 个月前 | ||
| 11 个月前 | ||
| 7 个月前 | ||
| 11 个月前 | ||
| 11 个月前 |