feat: allow readonly delegatecalls to the call actor precompiles#1739
feat: allow readonly delegatecalls to the call actor precompiles#1739wjmelements wants to merge 8 commits into
Conversation
Assisted-by: Claude:claude-sonnet-4-6
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1739 +/- ##
==========================================
+ Coverage 90.56% 90.57% +0.01%
==========================================
Files 140 140
Lines 27814 27840 +26
==========================================
+ Hits 25189 25217 +28
+ Misses 2625 2623 -2
🚀 New features to boost your workflow:
|
|
@wjmelements can you write a test for this that fails without the fix? This change hinges on ext_opcodes.rs has some relevant tests, that might be a good place to add a new one but you'll need to override |
Assisted-by: Claude:claude-haiku-4.5
…forcement Assisted-by: Claude:claude-sonnet-4-6
Assisted-by: Claude:claude-sonnet-4-6
…ecall in readonly context Assisted-by: Claude:claude-sonnet-4-6
|
I've added tests that would fail without this change and modified the I'll also add integration tests into ref-fvm, since without the explicit flag propagation, we depend on it to propagate the readonly state into subcalls.
There are filecoin methods that are read only; we should be able to execute them within a readonly context. It's still a separate hurdle that we can't call non- |
…_with_default Assisted-by: Claude:claude-sonnet-4-6
Reviewer @rvagg
Changes
Allow readonly delegatecall
Currently we require call actor (by address or by id) to use
delegatecall.But if the delegatecaller context is readonly (it or one of its parents is a
staticcall), that fails.The reason seems to be that we do
flush, so that reentrancy works (since it will reload).However, we skip flush if there's nothing to flush, and I think that's the case in this situation.
So I think we can allow this case.