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

Allow retrying failed transmissions #14017

Merged
merged 41 commits into from
Aug 8, 2024
Merged

Allow retrying failed transmissions #14017

merged 41 commits into from
Aug 8, 2024

Conversation

DeividasK
Copy link
Collaborator

@DeividasK DeividasK commented Aug 2, 2024

On-chain:

  • If the transmission is not successful, it can be retried.
  • Tracks the gas limit provided to the receiver function.
  • Tracks if the provided receiver address is invalid.

Off-chain:

  • Uses TransmissionState and gas provided to determine if the transmission should be attempted.

Copy link
Contributor

github-actions bot commented Aug 2, 2024

LCOV of commit 41f422b during Solidity Foundry #41049

Summary coverage rate:
  lines......: 98.7% (1838 of 1862 lines)
  functions..: 96.6% (344 of 356 functions)
  branches...: 90.7% (782 of 862 branches)

Files changed coverage rate: n/a

Base automatically changed from dk-disallow-zero-address-signers to develop August 2, 2024 13:58
assembly {
// call and return whether we succeeded. ignore return data
// call(gas,addr,value,argsOffset,argsLength,retOffset,retLength)
success := call(gasLimit, receiver, 0, add(payload, 0x20), mload(payload), 0x0, 0x0)
Copy link
Contributor

Choose a reason for hiding this comment

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

That success == false mean any reason for revert or only out of gas?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It can be either a revert (for whatever user reason) or out of gas (technically, still a revert).

core/capabilities/targets/write_target.go Outdated Show resolved Hide resolved
core/capabilities/targets/write_target.go Show resolved Hide resolved
/// @dev The gas we require to revert in case of a revert in the call to the
/// receiver. This is more than enough and does not attempt to be exact.
uint256 internal constant REQUIRED_GAS_FOR_ROUTING = 40_000;
bytes4 internal constant INSUFFICIENT_GAS_FOR_ROUTING_SIG = 0x0bfecd63;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to add a NatSpec comment for this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed it as it is unused 🙈

// ================================================================
// │ Router │
// ================================================================

mapping(address forwarder => bool) internal s_forwarders;
mapping(bytes32 transmissionId => TransmissionInfo) internal s_transmissions;
mapping(bytes32 transmissionId => Transmission) internal s_transmissions;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
mapping(bytes32 transmissionId => Transmission) internal s_transmissions;
mapping(bytes32 transmissionId => Transmission transmission) internal s_transmissions;

success := call(gasLimit, receiver, 0, add(payload, 0x20), mload(payload), 0x0, 0x0)
}

if (success) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this check just to prevent the storage write?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes.

@DeividasK DeividasK added this pull request to the merge queue Aug 7, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 7, 2024
@bolekk bolekk added this pull request to the merge queue Aug 8, 2024
Merged via the queue into develop with commit 1257d33 Aug 8, 2024
119 checks passed
@bolekk bolekk deleted the dk-call-with-exact-gas branch August 8, 2024 02:52
momentmaker added a commit that referenced this pull request Aug 8, 2024
* develop:
  CRIB CI integration (#13924)
  fix: refactor sonarqube scan args (#13875)
  BCI-3492 [LogPoller]: Allow withObservedExecAndRowsAffected to report non-zero rows affected (#14057)
  Add error mapping for Astar (#13990)
  [BCI-3862][chainlink] - Change DSL Block primitive to string instead of int (#14033)
  [KS-412] Validate called DON membership in TriggerPublisher (#14040)
  [TT-1429] notifying guardian on some failures (#14073)
  Add Mantle errors (#14053)
  Fix write target nil dereferences (#14059)
  Allow retrying failed transmissions (#14017)
  auto-11214: migrate more tests to foundry (#13934)
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.

3 participants