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

[CAPPL-58] Correctly stub out clock_time_get and poll_oneoff #778

Merged
merged 4 commits into from
Sep 23, 2024

Conversation

cedric-cordenier
Copy link
Contributor

@cedric-cordenier cedric-cordenier commented Sep 18, 2024

  • correctly stub out sleeping: the implementation is based on wazero's implementation of the syscalls, but with less support (eg. for file descriptor notifications, which we don't support anyway).
  • this includes stubbing out clock_time_get using a clock which ticks every time it's called and which is advanced by any time.Sleep calls.
  • make fuel optional
  • make sendResponse return an errno so that we can bubble this back to callers.

@cedric-cordenier cedric-cordenier changed the title Cappl 58 redux [CAPPL-58] Correctly stub out clock_time_get and poll_oneoff Sep 19, 2024
agparadiso
agparadiso previously approved these changes Sep 19, 2024
ErrnoNxio
// ErrnoOverflow Value too large to be stored in data type.
ErrnoOverflow
// ErrnoOwnerdead Previous owner died.
Copy link
Contributor

Choose a reason for hiding this comment

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

👻


engine := wasmtime.NewEngineWithConfig(cfg)

if !modCfg.IsUncompressed {
rdr := brotli.NewReader(bytes.NewBuffer(binary))
Copy link
Contributor

Choose a reason for hiding this comment

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

how did you choose brotli for the compression/decompression?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We did some benchmarking between gzip + brotli (and zopfli) and brotli offered the best mix of speed + compression performance.

@cedric-cordenier cedric-cordenier merged commit 61c2ccb into main Sep 23, 2024
9 of 11 checks passed
@cedric-cordenier cedric-cordenier deleted the CAPPL-58-redux branch September 23, 2024 11:30
cedric-cordenier added a commit that referenced this pull request Oct 4, 2024
* [CAPPL-58] Further cleanup

* [CAPPL-58] Add support for compression
cedric-cordenier added a commit that referenced this pull request Oct 10, 2024
* [CM-380] Identical Aggregator

* [CAPPL-60] Dynamic encoder selection in OCR consensus aggregator

* extract encoder name and config

* Add more tests

* add limit to seq num range (#781)

* [chore] Handle aliases in slices (#784)

* [chore] Handle aliases in slices

* More aliasing tests

* Lint fix

* Fix test

---------

Co-authored-by: Sri Kidambi <[email protected]>

* feat(observability-lib): legendoptions + improvement on node general dashboard (#785)

* [CAPPL-58] Correctly stub out clock_time_get and poll_oneoff (#778)

* [CAPPL-58] Further cleanup

* [CAPPL-58] Add support for compression

* More alias handling in Unwrap functionality of Value  (#792)

* Generic case to handle both pointer type and raw type and simplify int unwrap

* Handling interface and default

* Small test fix

---------

Co-authored-by: Cedric Cordenier <[email protected]>

* Fix alias typing and tests (#788)

* Fix alias typing and tests

* Fix ints

* errors.new instead of fmt

* Add array support to slice (#789)

* Replace fmt.Errorf with errors.New where possible (#795)

* chore(workflows): adds unit test to utils (#782)

* Have the mock runner register with capabilites (#783)

* Add binary + config to custom compute (#794)

* Add binary + config to custom compute

* Add binary + config to custom compute

* fix lint issues (#786)

* execution factory constructor updated to take two providers, chainIDs, and source token address (#641)

* execution factory constructor updated to take two providers and chain IDs

(cherry picked from commit 6ad1f08)

* Adding source token address to execution factory constructor

* Support passing in a values.Value to the chainreader GetLatestValue method (#779)

* add support for passing in a values.Value type to the contract readers GetLatestValue and QueryKey methods

---------

Co-authored-by: Sri Kidambi <[email protected]>
Co-authored-by: Cedric Cordenier <[email protected]>

* [CAPPL-31] feat(values): adds support for time.Time as value (#787)

* feat(values): adds support for time.Time as value

* chore(deps): updates .tool-versions

* refactor(values): uses primitive type in protos

* feat(values): support float64 values (#799)

* confidence level from string (#802)

* Float32/Float64 wrapping (#804)

* feat: implement sdk logger (#762)

* Add MustEmbed Constraint to Contract Reader (#801)

Reintroducing the must embed constraint to `ContractReader` implementations to
ensure that all implementations of `ContractReader` embed the `UnimplementedContractReader`.

If an implementation contains the unemplemented struct, changes to the interface
will flow down to all implementations without introducing breaking changes.

* Updated TestStruct to enable advanced querying (#798)

* Updated TestStruct to enable advanced querying

* linting fixes

* Update pkg/codec/encodings/type_codec_test.go

Co-authored-by: Clement <[email protected]>

* Update pkg/codec/encodings/type_codec_test.go

Co-authored-by: Clement <[email protected]>

* Fixed codec tests

---------

Co-authored-by: Clement <[email protected]>

* Properly support the range of uint64 and allow big int to unwrap into smaller integer types (#810)

* Extract expirable cache abstraction for reuse (#807)

* expirable_cache

* remove cache (#812)

* CCIP-3555 Attestation encoder interfaces (#813)

* Attestation encoder interfaces

* Attestation encoder interfaces

* Attestation encoder interfaces

* Comment

* [BCF-3392]  - ContractReaderByIDs Wrapper (#797)

* WIP

* Update ContractReaderByIDs interface method names

* Unexpose types.ContractReader in contractReaderByIDs

* Add multiple contract address support to fakeContractReader for tests

* Add GetLatestValue unit test for contractReaderByIDs

* Add GetLatestValue unit test for QueryKey

* Add BatchGetLatestValues unit test for CR by custom IdDs wrapper

* Rm ContractReaderByIDs interface and export the struct

* Change ContractReaderByIDs wrapper Unbind handling

* Improve ContractReaderByIDs wrapper err handling

* Remove mockery usage from ContractReaderByIDs tests

* lint

* pkg/types/ccipocr3: add DestExecData to RampTokenAmount (#817)

* pkg/types/ccipocr3: add DestExecData to RampTokenAmount

* fix test

* Allow the creation of maps from string to capbility outputs. (#815)

* Add the FeeValueJuels field to ccipocr3.Message (#819)

* feat(observability-lib): improve alerts rule (#803)

* feat(observability-lib): improve alerts rule

* chore(observability-lib): README + folder structure (#806)

* chore(observability-lib): README + folder structure

* feat(observability-lib): variable add current + includeAll options (#808)

* chore(README): small corrections

* chore(README): example improved

* chore(README): add references to dashboards examples

* feat(observability-lib): refactor exportable func + link to godoc

* fix(observability-lib): cmd errors returns

* enable errorf check (#826)

* Make overridding the encoder first-class

* Update mocks

* Mock updates

* Adjust tests

* Fix mock

* Fix mock

* Update mock

* Linting

---------

Co-authored-by: Cedric Cordenier <[email protected]>
Co-authored-by: dimitris <[email protected]>
Co-authored-by: Sri Kidambi <[email protected]>
Co-authored-by: Clement <[email protected]>
Co-authored-by: Ryan Tinianov <[email protected]>
Co-authored-by: Street <[email protected]>
Co-authored-by: Jordan Krage <[email protected]>
Co-authored-by: Patrick <[email protected]>
Co-authored-by: Matthew Pendrey <[email protected]>
Co-authored-by: Gabriel Paradiso <[email protected]>
Co-authored-by: Awbrey Hughlett <[email protected]>
Co-authored-by: Silas Lenihan <[email protected]>
Co-authored-by: Mateusz Sekara <[email protected]>
Co-authored-by: ilija42 <[email protected]>
Co-authored-by: Makram <[email protected]>
Co-authored-by: Ryan Stout <[email protected]>
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