Ethereum Contract Update

Getting up and running with Ethereum on Ubuntu Trusty has been fairly painless thanks to the truffle development environment. The HOWTO: Building Ethereum Apps With Truffle is a good introduction but a few details, like directory layout, have changed since then.

At the most recent Austin Ethereum meetup we had a conversation about how to handle the contingency of when you need to update your “contract” which has already been deployed to the blockchain. Using “contract” as the term for the main class makes the discussion of updating such code more difficult than it should be. Code often needs to be updated for new features or fixing bugs.

For instance, it is important to check (as mentioned in How to Write Safe Smart Contracts and Address types) the return value of send().

The “King of the Ether Throne” post-mortem shares the unenviable experience of not doing this check. The offending solidity code was

currentMonarch.etherAddress.send(compensation);

In this particular case, send() was failing because the destination address was a contract address (an Ethereum Mist “contract-based wallet”) and the default 2300 gas supplied by send() was insufficient for the destination contract to run. So, their fix was to define a new sendWithGas() function which allows extra gas to be sent and returns a boolean like send():

//Unfortunately destination.send() only includes a stipend of 2300 gas, which
//isn't enough to send ether to some wallet contracts - use this to add more.

function sendWithGas(address destination, uint256 value, uint256 extraGasAmt) internal returns (bool)
{
  return destination.call.value(value).gas(extraGasAmt)();
}

Now, the sendWithGas() return value is stored in a payment status and if that status is failure, the operation is cancelled with prior state restored.

Now, they just need to update their contract!

IIW21

The “Rebooting the Web of Trust” session by Christopher Allen at Internet Identity Workshop 21 was a nice summary of the submissions (the price of attendance) for an upcoming conference. Not only are the papers on Github but also issues are discussed.

IETF92

Hannes

Two weeks ago, I attended a day of sessions at IETF92 in Dallas. At the newcomer’s orientation, the IETF’s practice of measuring rough consensus with humming rather than a show of hands was covered. Scott Bradner explained that this accommodates the contigency of an employee of a company wanting to comfortably express preference for a view inconsistent with the view of the employee’s boss (an example of where anonymity is important). This assumes that there is enough people in the room to stay anonymous. However, I noticed that for trivial or non-controversial issues, a show of hands was used.

The remote participation tools for IETF are impressive and it was cool to see this in action. The media archives of past events is also a great resource. Here is the media for the OAuth session I attended.