Skip to content

set address in From optionally for CallOpts - #2290

Merged
skudasov merged 2 commits into
mainfrom
remove-callOpts-validation-for-read-only-mode
Nov 28, 2025
Merged

skudasov merged 2 commits into
mainfrom
remove-callOpts-validation-for-read-only-mode

Conversation

@skudasov

@skudasov skudasov commented Nov 27, 2025 •

Copy link
Copy Markdown
Contributor

Below is a summarization created by an LLM (gpt-4-0125-preview). Be mindful of hallucinations and verify accuracy.

Why

The changes aim to enhance how the NewCallOpts and NewCallKeyOpts functions in the seth client handle cases where no addresses are loaded or the specified key number is out of range. It addresses potential issues when calling view/pure functions without a sender, which may lead to incorrect behavior. Additionally, it simplifies error handling in these scenarios by removing redundant code and focusing on warning the user about possible implications.

What

  • seth/.changeset/v1.51.4.md
    • Added a markdown file to document the change for version 1.51.4, stating that the From field in bind.CallOpts is now optional and warns about potential issues with view/pure functions without a sender.
  • seth/client.go
    • Added a warning message constant WrnEmptyFromInCallOpts to notify users when no keys are found, and the From field in call options might be empty.
    • Modified NewCallOpts and NewCallKeyOpts functions to conditionally set the From field only if addresses are available, otherwise, log a warning message. This change removes the previous error handling where an error call options object was returned if the key number was out of range.
    • Removed the errCallOptsIfAddressCountTooLow function, which previously handled the error generation for out-of-range key numbers, simplifying the logic in creating call options.
    • Minor changes in gas estimation functions to use more concise function variable declarations.

@skudasov
skudasov force-pushed the remove-callOpts-validation-for-read-only-mode branch 3 times, most recently from 9fbca96 to 2441146 Compare November 28, 2025 08:29
@skudasov
skudasov force-pushed the remove-callOpts-validation-for-read-only-mode branch from 2441146 to 93fac19 Compare November 28, 2025 08:30
@skudasov
skudasov marked this pull request as ready for review November 28, 2025 11:10
@skudasov
skudasov requested a review from a team as a code owner November 28, 2025 11:10
@skudasov
skudasov merged commit 4c45835 into main Nov 28, 2025
74 of 76 checks passed
@skudasov
skudasov deleted the remove-callOpts-validation-for-read-only-mode branch November 28, 2025 11:16
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.

2 participants