merge sendRequest precompile into asyncCall#834
Conversation
e494a21 to
2e542ae
Compare
There was a problem hiding this comment.
Copilot reviewed 7 out of 9 changed files in this pull request and generated no comments.
Files not reviewed (2)
- nil/contracts/solidity/tests/TokensTest.sol: Language not supported
- smart-contracts/contracts/Nil.sol: Language not supported
Comments suppressed due to low confidence (8)
nil/tests/request_response/request_response_test.go:204
- TestInvalidContext now expects a failed receipt with status 'TooShortContextData'. Ensure this updated assertion aligns with the intended contract behavior.
s.Require().False(receipt.Success)
nil/services/rpc/rawapi/internal/local_call.go:107
- [nitpick] Verify that the shard ID check (if addr.ShardId() == newEs.ShardId) correctly filters out overrides and that the merging behavior meets the required logic.
for addr, override := range *prevOverrides {
nil/internal/vm/precompiled.go:331
- [nitpick] Returning baseFee on unpack errors or unexpected argument count may obscure underlying issues; confirm that this fallback is intentional and well documented.
if err != nil || len(args) != argtotal {
nil/internal/vm/precompiled.go:389
- Ensure that updating the expected number of arguments from 8 to 10 is consistent with the new asyncCall design and that all callers provide the correct arguments.
if len(args) != 10 {
nil/internal/execution/transactions.go:70
- [nitpick] Passing a 0 responseProcessingGas for the refund transaction appears intentional; verify that using 0 in this context meets the overall gas management strategy.
}, 0); err != nil {
nil/internal/execution/state.go:1002
- [nitpick] Ensure that passing a 0 responseProcessingGas for bounce transactions is appropriate and does not lead to unexpected gas handling in these cases.
if _, err = es.AddOutTransaction(txn.To, bounceTxn, 0); err != nil {
nil/internal/execution/state.go:1048
- [nitpick] Confirm that using 0 for responseProcessingGas in response transactions aligns with the overall design and does not inadvertently undercharge gas for these operations.
responseTxn, err := es.AddOutTransaction(txn.To, responsePayload, 0)
nil/internal/execution/state.go:960
- [nitpick] Verify that setting AsyncContext only when RequestContext is non-empty correctly handles all intended use cases, and that no valid scenarios are missed.
if len(payload.RequestContext) > 0 {
2e542ae to
12eb34d
Compare
Here we merge sendRequest precompile code into asyncCall precompile. At first it allows to eliminate code duplication and then it's the first step before implementation Awaiter contract that will include some request/response machinery for response processing.
12eb34d to
e6c5a88
Compare
|
LGTM, but tbh I'm not sure that I understand the purpose of such change. Both |
To remove one precompile right now. And to have common code for all communication types. |
Here we merge sendRequest precompile code into asyncCall precompile.
At first it allows to eliminate code duplication and then it's the first step before implementation Awaiter contract that will include some request/response machinery for response processing.