Skip to content

Commit

Permalink
Remove cheaters
Browse files Browse the repository at this point in the history
  • Loading branch information
pcw109550 committed Feb 8, 2024
1 parent 207235d commit f5200e1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 26 deletions.
2 changes: 0 additions & 2 deletions rvgo/fast/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import "github.com/ethereum/go-ethereum/crypto"

var (
StepBytes4 = crypto.Keccak256([]byte("step(bytes,bytes,bytes32)"))[:4]
CheatBytes4 = crypto.Keccak256([]byte("cheat(uint256,bytes32,bytes32,uint256)"))[:4]
CheatLocalKeyBytes4 = crypto.Keccak256([]byte("cheatLocalKey(uint256,bytes32,bytes32,uint256,bytes32)"))[:4]
LoadKeccak256PreimagePartBytes4 = crypto.Keccak256([]byte("loadKeccak256PreimagePart(uint256,bytes)"))[:4]
LoadLocalDataBytes4 = crypto.Keccak256([]byte("loadLocalData(uint256,bytes32,bytes32,uint256,uint256)"))[:4]
)
24 changes: 0 additions & 24 deletions rvsol/src/PreimageOracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,6 @@ contract PreimageOracle is IPreimageOracle {
dat_ = preimageParts[_key][_offset];
}

// TODO(CLI-4104):
// we need to mix-in the ID of the dispute for local-type keys to avoid collisions,
// and restrict local pre-image insertion to the dispute-managing contract.
// For now we permit anyone to write any pre-image unchecked, to make testing easy.
// This method is DANGEROUS. And NOT FOR PRODUCTION.
function cheat(uint256 partOffset, bytes32 key, bytes32 part, uint256 size) external {
preimagePartOk[key][partOffset] = true;
preimageParts[key][partOffset] = part;
preimageLengths[key] = size;
}

// temporary method for localization. Will be removed to PreimageKeyLib.sol
function localize(bytes32 _key, bytes32 _localContext) internal view returns (bytes32 localizedKey_) {
assembly {
Expand All @@ -51,19 +40,6 @@ contract PreimageOracle is IPreimageOracle {
}
}

// temporary method for localization. Will be removed to PreimageKeyLib.sol
function cheatLocalKey(uint256 partOffset, bytes32 key, bytes32 part, uint256 size, bytes32 localContext)
external
{
// sanity check key is local key using prefix
require(uint8(key[0]) == 1, "must be used for local key");

bytes32 localizedKey = PreimageKeyLib.localize(key, localContext);
preimagePartOk[localizedKey][partOffset] = true;
preimageParts[localizedKey][partOffset] = part;
preimageLengths[localizedKey] = size;
}

function loadLocalData(uint256 _ident, bytes32 _localContext, bytes32 _word, uint256 _size, uint256 _partOffset)
external
returns (bytes32 key_)
Expand Down

0 comments on commit f5200e1

Please sign in to comment.