Commit 546fc4bf authored by Mark Tyneway's avatar Mark Tyneway Committed by Andreas Bigger

op-node: revert trust rpc setting

parent 4dbb2afb
...@@ -74,6 +74,7 @@ func BuildL1DeveloperGenesis(config *DeployConfig, dump *gstate.Dump, l1Deployme ...@@ -74,6 +74,7 @@ func BuildL1DeveloperGenesis(config *DeployConfig, dump *gstate.Dump, l1Deployme
memDB.AddBalance(address, balance) memDB.AddBalance(address, balance)
memDB.SetCode(address, account.Code) memDB.SetCode(address, account.Code)
for key, value := range account.Storage { for key, value := range account.Storage {
log.Info("Setting storage", "name", name, "key", key.Hex(), "value", value)
memDB.SetState(address, key, common.HexToHash(value)) memDB.SetState(address, key, common.HexToHash(value))
} }
} }
...@@ -94,6 +95,8 @@ func BuildL1DeveloperGenesis(config *DeployConfig, dump *gstate.Dump, l1Deployme ...@@ -94,6 +95,8 @@ func BuildL1DeveloperGenesis(config *DeployConfig, dump *gstate.Dump, l1Deployme
// `block.number` is used during deployment and without specifically setting // `block.number` is used during deployment and without specifically setting
// the value to 0, it will cause underflow reverts for deposits in testing. // the value to 0, it will cause underflow reverts for deposits in testing.
func PostProcessL1DeveloperGenesis(stateDB *state.MemoryStateDB, deployments *L1Deployments) error { func PostProcessL1DeveloperGenesis(stateDB *state.MemoryStateDB, deployments *L1Deployments) error {
log.Info("Post processing state")
if stateDB == nil { if stateDB == nil {
return errors.New("cannot post process nil stateDB") return errors.New("cannot post process nil stateDB")
} }
...@@ -117,6 +120,7 @@ func PostProcessL1DeveloperGenesis(stateDB *state.MemoryStateDB, deployments *L1 ...@@ -117,6 +120,7 @@ func PostProcessL1DeveloperGenesis(stateDB *state.MemoryStateDB, deployments *L1
slot := common.BigToHash(big.NewInt(int64(entry.Slot))) slot := common.BigToHash(big.NewInt(int64(entry.Slot)))
stateDB.SetState(deployments.OptimismPortalProxy, slot, common.Hash{}) stateDB.SetState(deployments.OptimismPortalProxy, slot, common.Hash{})
log.Info("Post process update", "address", deployments.OptimismPortalProxy, "slot", slot.Hex(), "value", common.Hash{}.Hex())
return nil return nil
} }
...@@ -403,11 +403,6 @@ func (s *EthClient) GetStorageAt(ctx context.Context, address common.Address, st ...@@ -403,11 +403,6 @@ func (s *EthClient) GetStorageAt(ctx context.Context, address common.Address, st
// ReadStorageAt is a convenience method to read a single storage value at the given slot in the given account. // ReadStorageAt is a convenience method to read a single storage value at the given slot in the given account.
// The storage slot value is verified against the state-root of the given block if we do not trust the RPC provider, or directly retrieved without proof if we do trust the RPC. // The storage slot value is verified against the state-root of the given block if we do not trust the RPC provider, or directly retrieved without proof if we do trust the RPC.
func (s *EthClient) ReadStorageAt(ctx context.Context, address common.Address, storageSlot common.Hash, blockHash common.Hash) (common.Hash, error) { func (s *EthClient) ReadStorageAt(ctx context.Context, address common.Address, storageSlot common.Hash, blockHash common.Hash) (common.Hash, error) {
// TODO: temp
if true {
return s.GetStorageAt(ctx, address, storageSlot, blockHash.String())
}
if s.trustRPC { if s.trustRPC {
return s.GetStorageAt(ctx, address, storageSlot, blockHash.String()) return s.GetStorageAt(ctx, address, storageSlot, blockHash.String())
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment