Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert message address indexing. #2002

Merged
merged 3 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const topic = hre.ethers.id(eventSignature)

// Get the interface for the event in order to convert it to cross chain message.
let eventIface = new hre.ethers.Interface([ `event LogMessagePublished(address indexed,uint64,uint32,uint32,bytes,uint8)`]);
let eventIface = new hre.ethers.Interface([ `event LogMessagePublished(address,uint64,uint32,uint32,bytes,uint8)`]);

// This function converts the logs from transaction receipts into cross chain messages
function getXChainMessages(result: Receipt) {
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contracts/generated/EthereumBridge/EthereumBridge.go

Large diffs are not rendered by default.

Large diffs are not rendered by default.

28 changes: 9 additions & 19 deletions contracts/generated/MerkleTreeMessageBus/MerkleTreeMessageBus.go

Large diffs are not rendered by default.

28 changes: 9 additions & 19 deletions contracts/generated/MessageBus/MessageBus.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contracts/generated/ObsERC20/ObsERC20.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contracts/generated/ObscuroBridge/ObscuroBridge.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contracts/generated/WrappedERC20/WrappedERC20.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contracts/src/messaging/IMessageBus.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface IMessageBus {
// The enclave listens for it on the deployed message bus addresses.
event LogMessagePublished
(
address indexed sender,
address sender,
uint64 sequence,
uint32 nonce,
uint32 topic,
Expand Down
4 changes: 2 additions & 2 deletions contracts/test/bridge-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe("Bridge", function () {

const eventSignature = "LogMessagePublished(address,uint64,uint32,uint32,bytes,uint8)";
const topic = ethers.id(eventSignature)
let eventIface = new ethers.Interface([ `event LogMessagePublished(address indexed,uint64,uint32,uint32,bytes,uint8)`]);
let eventIface = new ethers.Interface([ `event LogMessagePublished(address,uint64,uint32,uint32,bytes,uint8)`]);

const receipt = (await tx.wait())!!;

Expand Down Expand Up @@ -283,7 +283,7 @@ describe("Bridge", function () {

await expect(event).to.not.be.undefined;

let eventIface = new ethers.Interface([ `event LogMessagePublished(address indexed,uint64,uint32,uint32,bytes,uint8)`]);
let eventIface = new ethers.Interface([ `event LogMessagePublished(address,uint64,uint32,uint32,bytes,uint8)`]);

const decodedEvent = eventIface.parseLog({
topics: event!.topics!.map((v)=>v),
Expand Down
5 changes: 0 additions & 5 deletions go/enclave/crosschain/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,11 @@ func convertLogsToMessages(logs []types.Log, eventName string, messageBusABI abi
messages := make(common.CrossChainMessages, 0)

for _, log := range logs {
if len(log.Topics) != 2 {
return nil, fmt.Errorf("invalid number of topics in log: %d", len(log.Topics))
}

var event MessageBus.MessageBusLogMessagePublished
err := messageBusABI.UnpackIntoInterface(&event, eventName, log.Data)
if err != nil {
return nil, err
}
event.Sender = gethcommon.BytesToAddress(log.Topics[1].Bytes())

msg := createCrossChainMessage(event)
messages = append(messages, msg)
Expand Down
Loading