taikoxyz / taiko-mono

A based rollup. 🥁
https://taiko.xyz
MIT License
4.16k stars 1.99k forks source link

suggestion:replace hardcode "bridge service" with B_BRIDGE #16975

Closed ddl-hust closed 2 weeks ago

ddl-hust commented 2 weeks ago

Describe the feature request

Read this document to learn more about how taiko deal with bridge, found some issues:

  1. isSignalReceived in doc cannot found, _isSignalReceived is private method. so original isSignalReceived seems renamed to isMessageReceived

  2. follow _isSignalReceived,trigger a internal contract call verifySignalReceived

    {
        try ISignalService(_signalService).verifySignalReceived(
            _chainId, resolve(_chainId, "bridge", false), _signal, _proof
        ) {
            return true;
        } catch {
            return false;
        }
    }

    resolve use chainID resolve name-to-address, LibString.sol define mappings between bytes32("bridge") and B_BRIDGE, My suggestion is to use unified identifiers globally to avoid hard coding and reduce errors.

Spam policy