@@ -1550,7 +1550,7 @@ def apply_message(
1550
1550
message : MessageAPI ,
1551
1551
transaction_context : TransactionContextAPI ) -> 'ComputationAPI' :
1552
1552
"""
1553
- Execution of a VM message. Typically used for sub-calls .
1553
+ Execute a VM message. This is where the VM-specific call logic exists .
1554
1554
"""
1555
1555
...
1556
1556
@@ -1562,7 +1562,8 @@ def apply_create_message(
1562
1562
message : MessageAPI ,
1563
1563
transaction_context : TransactionContextAPI ) -> 'ComputationAPI' :
1564
1564
"""
1565
- Execution of a VM message to create a new contract. Typically used for sub-calls.
1565
+ Execute a VM message to create a new contract. This is where the VM-specific
1566
+ create logic exists.
1566
1567
"""
1567
1568
...
1568
1569
@@ -1573,7 +1574,14 @@ def apply_computation(cls,
1573
1574
message : MessageAPI ,
1574
1575
transaction_context : TransactionContextAPI ) -> 'ComputationAPI' :
1575
1576
"""
1576
- Perform the computation that would be triggered by the VM message.
1577
+ Execute the logic within the message: Either run the precompile, or
1578
+ step through each opcode. Generally, the only VM-specific logic is for
1579
+ each opcode as it executes.
1580
+
1581
+ This should rarely be called directly, because it will skip over other important
1582
+ VM-specific logic that happens before or after the execution.
1583
+
1584
+ Instead, prefer :meth:`~apply_message` or :meth:`~apply_create_message`.
1577
1585
"""
1578
1586
...
1579
1587
@@ -2509,7 +2517,17 @@ def execute_bytecode(self,
2509
2517
code_address : Address = None ) -> ComputationAPI :
2510
2518
"""
2511
2519
Execute raw bytecode in the context of the current state of
2512
- the virtual machine.
2520
+ the virtual machine. Note that this skips over some of the logic
2521
+ that would normally happen during a call. Watch out for:
2522
+
2523
+ - value (ether) is *not* transferred
2524
+ - state is *not* rolled back in case of an error
2525
+ - The target account is *not* necessarily created
2526
+ - others...
2527
+
2528
+ For other potential surprises, check the implementation differences
2529
+ between :meth:`ComputationAPI.apply_computation` and
2530
+ :meth:`ComputationAPI.apply_message`. (depending on the VM fork)
2513
2531
"""
2514
2532
...
2515
2533
0 commit comments